<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>API Reference</title>

    <link rel="stylesheet" href="css/style.css" />
    <script src="js/all.js"></script>


          <script>
        $(function() {
            setupLanguages(["bash","javascript"]);
        });
      </script>
      </head>

  <body class="">
    <a href="#" id="nav-button">
      <span>
        NAV
        <img src="images/navbar.png" />
      </span>
    </a>
    <div class="tocify-wrapper">
        <img src="images/logo.png" />
                    <div class="lang-selector">
                                  <a href="#" data-language-name="bash">bash</a>
                                  <a href="#" data-language-name="javascript">javascript</a>
                            </div>
                            <div class="search">
              <input type="text" class="search" id="input-search" placeholder="Search">
            </div>
            <ul class="search-results"></ul>
              <div id="toc">
      </div>
                    <ul class="toc-footer">
                                  <li><a href='http://github.com/mpociot/documentarian'>Documentation Powered by Documentarian</a></li>
                            </ul>
            </div>
    <div class="page-wrapper">
      <div class="dark-box"></div>
      <div class="content">
          <!-- START_INFO -->
<h1>Info</h1>
<p>Welcome to the generated API reference.
<a href="http://localhost/docs/collection.json">Get Postman Collection</a></p>
<!-- END_INFO -->
<h1>logo图片</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_8efbd8b47d0f1ed64bccd669dda0b62a -->
<h2>logo图片查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/logo/index?name=nisi&amp;image=atque" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/logo/index"
);

let params = {
    "name": "nisi",
    "image": "atque",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/logo/index</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>名称</td>
</tr>
<tr>
<td><code>image</code></td>
<td>optional</td>
<td>图片</td>
</tr>
</tbody>
</table>
<!-- END_8efbd8b47d0f1ed64bccd669dda0b62a -->
<!-- START_1fef983362a2b4944bc71d8086052ba8 -->
<h2>logo图片修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/logo/update" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"earum","logo":2}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/logo/update"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "earum",
    "logo": 2
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/logo/update</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>名称</td>
</tr>
<tr>
<td><code>logo</code></td>
<td>integer</td>
<td>optional</td>
<td>图片id</td>
</tr>
</tbody>
</table>
<!-- END_1fef983362a2b4944bc71d8086052ba8 -->
<h1>三方调用接口 post方式</h1>
<p>json格式
字段:
function: 启用函数的功能
adduser 病人办理住院 数据添加
deleteuser 病人办理退院</p>
<pre><code>data: 数据
     adduser数据格式</code></pre>
<p>举例说明</p>
<p>{
function:adduser,</p>
<p>}</p>
<!-- START_ff76191cf484e14edcf3637dedb5b79f -->
<h2>api接口</h2>
<p>json格式
字段:
function: 启用函数的功能
adduser 病人办理住院 数据添加
deleteuser 病人办理退院</p>
<p>data: 数据
adduser数据格式</p>
<p>举例说明</p>
<p>{
function:adduser,</p>
<p>}</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/api/api" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"function":"cum","token":"est","time":12,"data":"ut"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/api/api"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "function": "cum",
    "token": "est",
    "time": 12,
    "data": "ut"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/api/api</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>function</code></td>
<td>string</td>
<td>required</td>
<td>调用的功能 adduser 住院 deleteuser出院</td>
</tr>
<tr>
<td><code>token</code></td>
<td>string</td>
<td>required</td>
<td>加密token</td>
</tr>
<tr>
<td><code>time</code></td>
<td>integer</td>
<td>required</td>
<td>时间戳 过期之后不能添加信息</td>
</tr>
<tr>
<td><code>data</code></td>
<td>string</td>
<td>required</td>
<td>数据json格式</td>
</tr>
</tbody>
</table>
<!-- END_ff76191cf484e14edcf3637dedb5b79f -->
<h1>口味</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_c7b60410f0f78d371fadca3895665b40 -->
<h2>口味查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/flavor?flavor=quibusdam&amp;business_id=rerum" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/flavor"
);

let params = {
    "flavor": "quibusdam",
    "business_id": "rerum",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/flavor</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>flavor</code></td>
<td>optional</td>
<td>口味信息</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_c7b60410f0f78d371fadca3895665b40 -->
<!-- START_b594f2f3ae9933e24f27ecb3b373dbcd -->
<h2>口味添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/flavor" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"flavor":"ipsum"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/flavor"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "flavor": "ipsum"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/flavor</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>flavor</code></td>
<td>required</td>
<td>optional</td>
<td>口味信息</td>
</tr>
</tbody>
</table>
<!-- END_b594f2f3ae9933e24f27ecb3b373dbcd -->
<!-- START_1be4a3c7325dbef32bb7cc3accd37fa0 -->
<h2>口味查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/flavor/1?flavor=asperiores&amp;business_id=dolorem" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/flavor/1"
);

let params = {
    "flavor": "asperiores",
    "business_id": "dolorem",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/flavor/{flavor}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>flavor</code></td>
<td>optional</td>
<td>口味信息</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_1be4a3c7325dbef32bb7cc3accd37fa0 -->
<!-- START_d0edfc5241461e8b822c5d40bbf01f37 -->
<h2>口味信息修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/order/flavor/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"flavor":"et"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/flavor/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "flavor": "et"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/order/flavor/{flavor}</code></p>
<p><code>PATCH api/order/flavor/{flavor}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>flavor</code></td>
<td>required</td>
<td>optional</td>
<td>口味信息</td>
</tr>
</tbody>
</table>
<!-- END_d0edfc5241461e8b822c5d40bbf01f37 -->
<!-- START_49ba475354f37e320f84e78a415bc4f1 -->
<h2>口味信息删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/order/flavor/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/flavor/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/order/flavor/{flavor}</code></p>
<!-- END_49ba475354f37e320f84e78a415bc4f1 -->
<h1>后台地址管理</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_6778e8a61fe402d08d0e2f6fb15e8022 -->
<h2>后台地址管理查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/admin/address?name=aut" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/admin/address"
);

let params = {
    "name": "aut",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (200):</p>
</blockquote>
<pre><code class="language-json">[
    {
        "id": 2,
        "name": "b区1号楼5层",
        "created_at": null,
        "updated_at": null
    },
    {
        "id": 3,
        "name": "c区1号楼2层",
        "created_at": "2020-02-26 10:06:25",
        "updated_at": "2020-02-26 10:06:25"
    }
]</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/admin/address</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>string 姓名</td>
</tr>
</tbody>
</table>
<!-- END_6778e8a61fe402d08d0e2f6fb15e8022 -->
<!-- START_2de4b735e35489a88e84e0884f487ab1 -->
<h2>后台地址管理添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/admin/address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"ut"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/admin/address"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "ut"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/admin/address</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>地址信息</td>
</tr>
</tbody>
</table>
<!-- END_2de4b735e35489a88e84e0884f487ab1 -->
<!-- START_fd5520b40ed84d5905053eadbfd9148a -->
<h2>后台地址管理查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/admin/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/admin/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (404):</p>
</blockquote>
<pre><code class="language-json">{
    "message": "没有该信息"
}</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/admin/address/{address}</code></p>
<!-- END_fd5520b40ed84d5905053eadbfd9148a -->
<!-- START_7261c8e8f9a95b2273e6a296b99a6ca6 -->
<h2>后台地址管理修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/admin/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"accusamus"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/admin/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "accusamus"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/admin/address/{address}</code></p>
<p><code>PATCH api/admin/address/{address}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>地址信息</td>
</tr>
</tbody>
</table>
<!-- END_7261c8e8f9a95b2273e6a296b99a6ca6 -->
<!-- START_dc63b56187b0bd5b38b328a09954fbcf -->
<h2>后台地址管理查看删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/admin/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/admin/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/admin/address/{address}</code></p>
<!-- END_dc63b56187b0bd5b38b328a09954fbcf -->
<h1>后台管理员密码登录逻辑</h1>
<!-- START_3de0e0e764b6e66512ed179fb48ffb73 -->
<h2>返回状态码对应消息</h2>
<p>400 参数错误
411 未上传密码
412 没有对应管理员
413 密码错误
200 登陆成功 并且返回的内容是token 可以直接进行会话</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/admin/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"number":6,"pwd":"et"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/admin/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "number": 6,
    "pwd": "et"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/admin/token</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>number</code></td>
<td>integer</td>
<td>required</td>
<td>手机号/账号</td>
</tr>
<tr>
<td><code>pwd</code></td>
<td>string</td>
<td>optional</td>
<td>optional 密码</td>
</tr>
</tbody>
</table>
<!-- END_3de0e0e764b6e66512ed179fb48ffb73 -->
<h1>后台管理员短信或密码忘记密码逻辑-&gt;验证码短信验证码修改密码模式</h1>
<!-- START_b7f5ec6fd6f8adea64ccc7b9dd8c6ea4 -->
<h2>返回状态码对应消息</h2>
<p>400 参数错误
411 没有提交值
412 没有新密码
413 该商家不存在
414 验证码已经失效 请重新发送
415 验证码错误
416 修改密码失败
200 修改成功</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/forget/admin/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":17,"code":3,"pwd":"ad"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/forget/admin/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 17,
    "code": 3,
    "pwd": "ad"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/forget/admin/token</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>code</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 验证码</td>
</tr>
<tr>
<td><code>pwd</code></td>
<td>string</td>
<td>optional</td>
<td>optional 密码</td>
</tr>
</tbody>
</table>
<!-- END_b7f5ec6fd6f8adea64ccc7b9dd8c6ea4 -->
<h1>商品信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_09c2e1a82859ffabfafc0582784e3826 -->
<h2>商品查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/info?food_item=deserunt&amp;food_id=deserunt&amp;name=qui&amp;body=et&amp;food_num=corrupti&amp;num=aut&amp;color=voluptatem&amp;number=molestias&amp;brand_id=optio&amp;category_id=officiis&amp;price=commodi&amp;sort=voluptatem&amp;Recommend=vitae&amp;new_products=in&amp;market_price=asperiores&amp;hot_sale=quaerat&amp;status=mollitia&amp;food_classification_id=nulla&amp;image=dolore&amp;abbreviation=nihil&amp;classification-%E3%80%8Bclassification=et&amp;business=nihil&amp;category-%E3%80%8Bname=et" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"search":"libero","business_id":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info"
);

let params = {
    "food_item": "deserunt",
    "food_id": "deserunt",
    "name": "qui",
    "body": "et",
    "food_num": "corrupti",
    "num": "aut",
    "color": "voluptatem",
    "number": "molestias",
    "brand_id": "optio",
    "category_id": "officiis",
    "price": "commodi",
    "sort": "voluptatem",
    "Recommend": "vitae",
    "new_products": "in",
    "market_price": "asperiores",
    "hot_sale": "quaerat",
    "status": "mollitia",
    "food_classification_id": "nulla",
    "image": "dolore",
    "abbreviation": "nihil",
    "classification-》classification": "et",
    "business": "nihil",
    "category-》name": "et",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "search": "libero",
    "business_id": 8
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/info</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food_item</code></td>
<td>optional</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>food_id</code></td>
<td>optional</td>
<td>商品id</td>
</tr>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>商品名称</td>
</tr>
<tr>
<td><code>body</code></td>
<td>optional</td>
<td>食品介绍</td>
</tr>
<tr>
<td><code>food_num</code></td>
<td>optional</td>
<td>食品库存</td>
</tr>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>食品销量</td>
</tr>
<tr>
<td><code>color</code></td>
<td>optional</td>
<td>颜色</td>
</tr>
<tr>
<td><code>number</code></td>
<td>optional</td>
<td>数量 默认0</td>
</tr>
<tr>
<td><code>brand_id</code></td>
<td>optional</td>
<td>食品品牌id</td>
</tr>
<tr>
<td><code>category_id</code></td>
<td>optional</td>
<td>类目id</td>
</tr>
<tr>
<td><code>price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>optional</td>
<td>排序</td>
</tr>
<tr>
<td><code>Recommend</code></td>
<td>optional</td>
<td>是否推荐  0 不推荐 1推荐</td>
</tr>
<tr>
<td><code>new_products</code></td>
<td>optional</td>
<td>是否新品 0不是 1是</td>
</tr>
<tr>
<td><code>market_price</code></td>
<td>optional</td>
<td>市场价格</td>
</tr>
<tr>
<td><code>hot_sale</code></td>
<td>optional</td>
<td>是否热卖 0不是 1是</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>是否上架 0下架 1上架</td>
</tr>
<tr>
<td><code>food_classification_id</code></td>
<td>optional</td>
<td>分类</td>
</tr>
<tr>
<td><code>image</code></td>
<td>optional</td>
<td>食品图片</td>
</tr>
<tr>
<td><code>abbreviation</code></td>
<td>optional</td>
<td>食品缩略图片</td>
</tr>
<tr>
<td><code>classification-》classification</code></td>
<td>optional</td>
<td>所属分类</td>
</tr>
<tr>
<td><code>business</code></td>
<td>optional</td>
<td>对应商家信息</td>
</tr>
<tr>
<td><code>category-》name</code></td>
<td>optional</td>
<td>对应类目</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>search</code></td>
<td>string</td>
<td>optional</td>
<td>商品名称</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>integer</td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_09c2e1a82859ffabfafc0582784e3826 -->
<!-- START_3b7527353931766e9a0ab3c55b2f273f -->
<h2>商品添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/food/info" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"food_id":18,"food_item":20,"name":"recusandae","body":"officiis","color":"consequatur","food_num":13,"num":18,"brand_id":3,"category_id":9,"price":12,"sort":15,"Recommend":2,"new_products":16,"market_price":13,"hot_sale":12,"status":3,"class":"rerum","image":1,"abbreviation":14,"business_id":20}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "food_id": 18,
    "food_item": 20,
    "name": "recusandae",
    "body": "officiis",
    "color": "consequatur",
    "food_num": 13,
    "num": 18,
    "brand_id": 3,
    "category_id": 9,
    "price": 12,
    "sort": 15,
    "Recommend": 2,
    "new_products": 16,
    "market_price": 13,
    "hot_sale": 12,
    "status": 3,
    "class": "rerum",
    "image": 1,
    "abbreviation": 14,
    "business_id": 20
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/food/info</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food_id</code></td>
<td>integer</td>
<td>required</td>
<td>商品id</td>
</tr>
<tr>
<td><code>food_item</code></td>
<td>integer</td>
<td>required</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>商品名称</td>
</tr>
<tr>
<td><code>body</code></td>
<td>string</td>
<td>required</td>
<td>食品介绍</td>
</tr>
<tr>
<td><code>color</code></td>
<td>string</td>
<td>required</td>
<td>颜色</td>
</tr>
<tr>
<td><code>food_num</code></td>
<td>integer</td>
<td>required</td>
<td>食品库存</td>
</tr>
<tr>
<td><code>num</code></td>
<td>integer</td>
<td>required</td>
<td>食品销量</td>
</tr>
<tr>
<td><code>brand_id</code></td>
<td>integer</td>
<td>required</td>
<td>食品品牌id</td>
</tr>
<tr>
<td><code>category_id</code></td>
<td>integer</td>
<td>required</td>
<td>类目id</td>
</tr>
<tr>
<td><code>price</code></td>
<td>integer</td>
<td>required</td>
<td>价格</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>integer</td>
<td>required</td>
<td>排序</td>
</tr>
<tr>
<td><code>Recommend</code></td>
<td>integer</td>
<td>required</td>
<td>是否推荐  0 不推荐 1推荐</td>
</tr>
<tr>
<td><code>new_products</code></td>
<td>integer</td>
<td>required</td>
<td>是否新品 0不是 1是</td>
</tr>
<tr>
<td><code>market_price</code></td>
<td>integer</td>
<td>required</td>
<td>市场价格</td>
</tr>
<tr>
<td><code>hot_sale</code></td>
<td>integer</td>
<td>required</td>
<td>是否热卖 0不是 1是</td>
</tr>
<tr>
<td><code>status</code></td>
<td>integer</td>
<td>required</td>
<td>是否上架 0下架 1上架</td>
</tr>
<tr>
<td><code>class</code></td>
<td>json</td>
<td>required</td>
<td>分类</td>
</tr>
<tr>
<td><code>image</code></td>
<td>integer</td>
<td>required</td>
<td>食品图片</td>
</tr>
<tr>
<td><code>abbreviation</code></td>
<td>integer</td>
<td>optional</td>
<td>食品缩略图片</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>integer</td>
<td>required</td>
<td>对应商家id 商家不用传，管理员要传</td>
</tr>
</tbody>
</table>
<!-- END_3b7527353931766e9a0ab3c55b2f273f -->
<!-- START_d9402d189a8b26d258c80a3ac4413aa8 -->
<h2>商品查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/info/1?food_id=cumque&amp;food_item=inventore&amp;name=necessitatibus&amp;body=quia&amp;food_num=molestiae&amp;num=consectetur&amp;color=repudiandae&amp;number=excepturi&amp;brand_id=reiciendis&amp;category_id=ut&amp;price=reiciendis&amp;sort=voluptatem&amp;Recommend=cumque&amp;new_products=enim&amp;market_price=et&amp;hot_sale=quia&amp;status=labore&amp;food_classification_id=perspiciatis&amp;image=nihil&amp;abbreviation=maiores&amp;classification-%E3%80%8Bclassification=pariatur&amp;business=tenetur&amp;category-%E3%80%8Bname=qui&amp;sale=dicta" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info/1"
);

let params = {
    "food_id": "cumque",
    "food_item": "inventore",
    "name": "necessitatibus",
    "body": "quia",
    "food_num": "molestiae",
    "num": "consectetur",
    "color": "repudiandae",
    "number": "excepturi",
    "brand_id": "reiciendis",
    "category_id": "ut",
    "price": "reiciendis",
    "sort": "voluptatem",
    "Recommend": "cumque",
    "new_products": "enim",
    "market_price": "et",
    "hot_sale": "quia",
    "status": "labore",
    "food_classification_id": "perspiciatis",
    "image": "nihil",
    "abbreviation": "maiores",
    "classification-》classification": "pariatur",
    "business": "tenetur",
    "category-》name": "qui",
    "sale": "dicta",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/info/{info}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food_id</code></td>
<td>optional</td>
<td>商品id</td>
</tr>
<tr>
<td><code>food_item</code></td>
<td>optional</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>商品名称</td>
</tr>
<tr>
<td><code>body</code></td>
<td>optional</td>
<td>食品介绍</td>
</tr>
<tr>
<td><code>food_num</code></td>
<td>optional</td>
<td>食品库存</td>
</tr>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>食品销量</td>
</tr>
<tr>
<td><code>color</code></td>
<td>optional</td>
<td>颜色</td>
</tr>
<tr>
<td><code>number</code></td>
<td>optional</td>
<td>数量 默认0</td>
</tr>
<tr>
<td><code>brand_id</code></td>
<td>optional</td>
<td>食品品牌id</td>
</tr>
<tr>
<td><code>category_id</code></td>
<td>optional</td>
<td>类目id</td>
</tr>
<tr>
<td><code>price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>optional</td>
<td>排序</td>
</tr>
<tr>
<td><code>Recommend</code></td>
<td>optional</td>
<td>是否推荐  0 不推荐 1推荐</td>
</tr>
<tr>
<td><code>new_products</code></td>
<td>optional</td>
<td>是否新品 0不是 1是</td>
</tr>
<tr>
<td><code>market_price</code></td>
<td>optional</td>
<td>市场价格</td>
</tr>
<tr>
<td><code>hot_sale</code></td>
<td>optional</td>
<td>是否热卖 0不是 1是</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>是否上架 0下架 1上架</td>
</tr>
<tr>
<td><code>food_classification_id</code></td>
<td>optional</td>
<td>分类</td>
</tr>
<tr>
<td><code>image</code></td>
<td>optional</td>
<td>食品图片</td>
</tr>
<tr>
<td><code>abbreviation</code></td>
<td>optional</td>
<td>食品缩略图片</td>
</tr>
<tr>
<td><code>classification-》classification</code></td>
<td>optional</td>
<td>所属分类</td>
</tr>
<tr>
<td><code>business</code></td>
<td>optional</td>
<td>对应商家信息</td>
</tr>
<tr>
<td><code>category-》name</code></td>
<td>optional</td>
<td>对应类目</td>
</tr>
<tr>
<td><code>sale</code></td>
<td>optional</td>
<td>相关推荐</td>
</tr>
</tbody>
</table>
<!-- END_d9402d189a8b26d258c80a3ac4413aa8 -->
<!-- START_a569d3660612885b212892c5a8ed3dc2 -->
<h2>商品修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/food/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"food_id":8,"food_item":6,"name":"laudantium","body":"ex","color":"praesentium","food_num":19,"num":3,"brand_id":19,"category_id":2,"price":133.709281,"sort":18,"Recommend":17,"new_products":11,"market_price":20,"hot_sale":6,"status":11,"class":"perspiciatis","image":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "food_id": 8,
    "food_item": 6,
    "name": "laudantium",
    "body": "ex",
    "color": "praesentium",
    "food_num": 19,
    "num": 3,
    "brand_id": 19,
    "category_id": 2,
    "price": 133.709281,
    "sort": 18,
    "Recommend": 17,
    "new_products": 11,
    "market_price": 20,
    "hot_sale": 6,
    "status": 11,
    "class": "perspiciatis",
    "image": 8
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/food/info/{info}</code></p>
<p><code>PATCH api/food/info/{info}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food_id</code></td>
<td>integer</td>
<td>optional</td>
<td>商品id</td>
</tr>
<tr>
<td><code>food_item</code></td>
<td>integer</td>
<td>optional</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>商品名称</td>
</tr>
<tr>
<td><code>body</code></td>
<td>string</td>
<td>optional</td>
<td>食品介绍</td>
</tr>
<tr>
<td><code>color</code></td>
<td>string</td>
<td>optional</td>
<td>颜色</td>
</tr>
<tr>
<td><code>food_num</code></td>
<td>integer</td>
<td>optional</td>
<td>食品库存</td>
</tr>
<tr>
<td><code>num</code></td>
<td>integer</td>
<td>optional</td>
<td>食品销量</td>
</tr>
<tr>
<td><code>brand_id</code></td>
<td>integer</td>
<td>optional</td>
<td>食品品牌id</td>
</tr>
<tr>
<td><code>category_id</code></td>
<td>integer</td>
<td>optional</td>
<td>类目id</td>
</tr>
<tr>
<td><code>price</code></td>
<td>float</td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>integer</td>
<td>optional</td>
<td>排序</td>
</tr>
<tr>
<td><code>Recommend</code></td>
<td>integer</td>
<td>optional</td>
<td>是否推荐  0 不推荐 1推荐</td>
</tr>
<tr>
<td><code>new_products</code></td>
<td>integer</td>
<td>optional</td>
<td>是否新品 0不是 1是</td>
</tr>
<tr>
<td><code>market_price</code></td>
<td>integer</td>
<td>optional</td>
<td>市场价格</td>
</tr>
<tr>
<td><code>hot_sale</code></td>
<td>integer</td>
<td>optional</td>
<td>是否热卖 0不是 1是</td>
</tr>
<tr>
<td><code>status</code></td>
<td>integer</td>
<td>optional</td>
<td>是否上架 0下架 1上架</td>
</tr>
<tr>
<td><code>class</code></td>
<td>json</td>
<td>optional</td>
<td>分类</td>
</tr>
<tr>
<td><code>image</code></td>
<td>integer</td>
<td>optional</td>
<td>食品图片</td>
</tr>
</tbody>
</table>
<!-- END_a569d3660612885b212892c5a8ed3dc2 -->
<!-- START_6f40828707aae8a1325c0fcb7fb2a68f -->
<h2>商品信息删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/food/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/food/info/{info}</code></p>
<!-- END_6f40828707aae8a1325c0fcb7fb2a68f -->
<!-- START_2714404e69b22d305fc85666dcbfb503 -->
<h2>商品删除（多个）</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/food/info/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"id":"voluptatem"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/info/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": "voluptatem"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/food/info/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>json</td>
<td>optional</td>
<td>optional 商品id {&quot;0&quot;:{&quot;id&quot;:23},&quot;1&quot;:{&quot;id&quot;:24}}</td>
</tr>
</tbody>
</table>
<!-- END_2714404e69b22d305fc85666dcbfb503 -->
<h1>商品分类</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_2ac9357c735a34e46286764565d7ac98 -->
<h2>商品分类查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/classification?name=dolores" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"pid":"nemo","level":19}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/classification"
);

let params = {
    "name": "dolores",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "pid": "nemo",
    "level": 19
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/classification</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>分类名字</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>pid</code></td>
<td>int分类id</td>
<td>optional</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_2ac9357c735a34e46286764565d7ac98 -->
<!-- START_4320f9f67e939315143b19f86e9b88d8 -->
<h2>商品分类添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/food/classification" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"dolorum","pid":7,"sort":10,"level":5}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/classification"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "dolorum",
    "pid": 7,
    "sort": 10,
    "level": 5
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/food/classification</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>分类名字</td>
</tr>
<tr>
<td><code>pid</code></td>
<td>integer</td>
<td>required</td>
<td>分类上级</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>integer</td>
<td>required</td>
<td>排序</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_4320f9f67e939315143b19f86e9b88d8 -->
<!-- START_ab40222c1db6bee2b8c3a9f21cafea29 -->
<h2>商品分类信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/classification/1?name=et" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"level":11}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/classification/1"
);

let params = {
    "name": "et",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "level": 11
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/classification/{classification}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>分类名字</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_ab40222c1db6bee2b8c3a9f21cafea29 -->
<!-- START_2556cdf12d1c1bcdfc8a4ee370aa31a4 -->
<h2>商品分类修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/food/classification/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"beatae","pid":15,"sort":10,"level":7}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/classification/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "beatae",
    "pid": 15,
    "sort": 10,
    "level": 7
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/food/classification/{classification}</code></p>
<p><code>PATCH api/food/classification/{classification}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>分类名字</td>
</tr>
<tr>
<td><code>pid</code></td>
<td>integer</td>
<td>optional</td>
<td>分类上级</td>
</tr>
<tr>
<td><code>sort</code></td>
<td>integer</td>
<td>required</td>
<td>排序</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_2556cdf12d1c1bcdfc8a4ee370aa31a4 -->
<!-- START_fc95d3fb17f26b649f78b181f750a51a -->
<h2>商品分类删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/food/classification/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"level":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/classification/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "level": 8
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/food/classification/{classification}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_fc95d3fb17f26b649f78b181f750a51a -->
<!-- START_cd9d4d94ea110888c01840c8769a2f05 -->
<h2>主页搜索</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/classification/search" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"rerum"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/classification/search"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "rerum"
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (200):</p>
</blockquote>
<pre><code class="language-json">[]</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/classification/search</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>名称</td>
<td>optional</td>
</tr>
</tbody>
</table>
<!-- END_cd9d4d94ea110888c01840c8769a2f05 -->
<h1>商家信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_98caa350484207fd74025f501473251d -->
<h2>商家信息查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/info?name=delectus&amp;user_title=assumenda&amp;user_name=inventore&amp;password=mollitia&amp;user_status=voluptatem&amp;phone=quos&amp;address=et&amp;body=voluptatem&amp;consumption=eius&amp;cost=aspernatur&amp;time-%3Estart_time=tenetur&amp;time-%3Eend_time=quia&amp;time-%3Eday=voluptatem&amp;sales=sit&amp;status=qui&amp;because=quia&amp;shop_image=sint&amp;display_show=aperiam&amp;Business_license=et&amp;food=est&amp;food-%3Eclassification-%3Eclassification=quos&amp;category-%E3%80%8Bname=maxime&amp;time_status=optio" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"search":"ad","phone":"hic","name":"asperiores","class":1,"user_name":15,"user_status":15,"status":11}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info"
);

let params = {
    "name": "delectus",
    "user_title": "assumenda",
    "user_name": "inventore",
    "password": "mollitia",
    "user_status": "voluptatem",
    "phone": "quos",
    "address": "et",
    "body": "voluptatem",
    "consumption": "eius",
    "cost": "aspernatur",
    "time-&amp;gt;start_time": "tenetur",
    "time-&amp;gt;end_time": "quia",
    "time-&amp;gt;day": "voluptatem",
    "sales": "sit",
    "status": "qui",
    "because": "quia",
    "shop_image": "sint",
    "display_show": "aperiam",
    "Business_license": "et",
    "food": "est",
    "food-&amp;gt;classification-&amp;gt;classification": "quos",
    "category-》name": "maxime",
    "time_status": "optio",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "search": "ad",
    "phone": "hic",
    "name": "asperiores",
    "class": 1,
    "user_name": 15,
    "user_status": 15,
    "status": 11
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/info</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>联系人</td>
</tr>
<tr>
<td><code>user_title</code></td>
<td>optional</td>
<td>商家名称</td>
</tr>
<tr>
<td><code>user_name</code></td>
<td>optional</td>
<td>账户</td>
</tr>
<tr>
<td><code>password</code></td>
<td>optional</td>
<td>密码</td>
</tr>
<tr>
<td><code>user_status</code></td>
<td>optional</td>
<td>账户状态 0禁用 1启用</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>body</code></td>
<td>optional</td>
<td>店铺介绍</td>
</tr>
<tr>
<td><code>consumption</code></td>
<td>optional</td>
<td>人均消费</td>
</tr>
<tr>
<td><code>cost</code></td>
<td>optional</td>
<td>配送费</td>
</tr>
<tr>
<td><code>time-&amp;gt;start_time</code></td>
<td>optional</td>
<td>营业开始时间</td>
</tr>
<tr>
<td><code>time-&amp;gt;end_time</code></td>
<td>optional</td>
<td>营业结束时间</td>
</tr>
<tr>
<td><code>time-&amp;gt;day</code></td>
<td>optional</td>
<td>营业时间 1：星期1 2：星期2 .. 0 星期天</td>
</tr>
<tr>
<td><code>sales</code></td>
<td>optional</td>
<td>月销量</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>状态 0审核中1正常2失败</td>
</tr>
<tr>
<td><code>because</code></td>
<td>optional</td>
<td>原因</td>
</tr>
<tr>
<td><code>shop_image</code></td>
<td>optional</td>
<td>店铺形象图片</td>
</tr>
<tr>
<td><code>display_show</code></td>
<td>optional</td>
<td>店铺展示图</td>
</tr>
<tr>
<td><code>Business_license</code></td>
<td>optional</td>
<td>营业执照图</td>
</tr>
<tr>
<td><code>food</code></td>
<td>optional</td>
<td>对应食品</td>
</tr>
<tr>
<td><code>food-&amp;gt;classification-&amp;gt;classification</code></td>
<td>optional</td>
<td>对应分类</td>
</tr>
<tr>
<td><code>category-》name</code></td>
<td>optional</td>
<td>对应类目</td>
</tr>
<tr>
<td><code>time_status</code></td>
<td>optional</td>
<td>营业还是打烊 1 营业 0打烊</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>search</code></td>
<td>string</td>
<td>optional</td>
<td>商家名称</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>optional</td>
<td>联系人电话</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>联系人姓名</td>
</tr>
<tr>
<td><code>class</code></td>
<td>integer</td>
<td>optional</td>
<td>对应分类</td>
</tr>
<tr>
<td><code>user_name</code></td>
<td>integer</td>
<td>optional</td>
<td>账号</td>
</tr>
<tr>
<td><code>user_status</code></td>
<td>integer</td>
<td>optional</td>
<td>账号状态 0禁用 1启用</td>
</tr>
<tr>
<td><code>status</code></td>
<td>integer</td>
<td>optional</td>
<td>审核状态 0审核中 1成功 2失败</td>
</tr>
</tbody>
</table>
<!-- END_98caa350484207fd74025f501473251d -->
<!-- START_9b83dae453bd0fe055ce8f8a1c47743b -->
<h2>商家信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/info/1?name=aut&amp;user_title=ut&amp;user_name=deleniti&amp;password=fugiat&amp;user_status=enim&amp;phone=libero&amp;address=rem&amp;body=quidem&amp;cost=officiis&amp;consumption=fugit&amp;time-%3Estart_time=harum&amp;time-%3Eend_time=vitae&amp;time-%3Eday=eius&amp;sales=optio&amp;status=minus&amp;because=et&amp;shop_image=culpa&amp;display_show=dolore&amp;Business_license=ut&amp;food-%3Eclassification-%3Eclassification=veniam&amp;category-%3Ename=fugiat&amp;classification-%3Eclass=accusantium&amp;category-%3Efood=recusandae&amp;time_status=ratione" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info/1"
);

let params = {
    "name": "aut",
    "user_title": "ut",
    "user_name": "deleniti",
    "password": "fugiat",
    "user_status": "enim",
    "phone": "libero",
    "address": "rem",
    "body": "quidem",
    "cost": "officiis",
    "consumption": "fugit",
    "time-&amp;gt;start_time": "harum",
    "time-&amp;gt;end_time": "vitae",
    "time-&amp;gt;day": "eius",
    "sales": "optio",
    "status": "minus",
    "because": "et",
    "shop_image": "culpa",
    "display_show": "dolore",
    "Business_license": "ut",
    "food-&amp;gt;classification-&amp;gt;classification": "veniam",
    "category-&amp;gt;name": "fugiat",
    "classification-&amp;gt;class": "accusantium",
    "category-&amp;gt;food": "recusandae",
    "time_status": "ratione",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/info/{info}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>联系人</td>
</tr>
<tr>
<td><code>user_title</code></td>
<td>optional</td>
<td>商家名称</td>
</tr>
<tr>
<td><code>user_name</code></td>
<td>optional</td>
<td>账户</td>
</tr>
<tr>
<td><code>password</code></td>
<td>optional</td>
<td>密码</td>
</tr>
<tr>
<td><code>user_status</code></td>
<td>optional</td>
<td>账户状态 0禁用 1启用</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>body</code></td>
<td>optional</td>
<td>店铺介绍</td>
</tr>
<tr>
<td><code>cost</code></td>
<td>optional</td>
<td>配送费</td>
</tr>
<tr>
<td><code>consumption</code></td>
<td>optional</td>
<td>人均消费</td>
</tr>
<tr>
<td><code>time-&amp;gt;start_time</code></td>
<td>optional</td>
<td>营业开始时间</td>
</tr>
<tr>
<td><code>time-&amp;gt;end_time</code></td>
<td>optional</td>
<td>营业结束时间</td>
</tr>
<tr>
<td><code>time-&amp;gt;day</code></td>
<td>optional</td>
<td>营业时间 1：星期1 2：星期2 .. 0 星期天</td>
</tr>
<tr>
<td><code>sales</code></td>
<td>optional</td>
<td>月销量</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>状态 0审核中1正常2失败</td>
</tr>
<tr>
<td><code>because</code></td>
<td>optional</td>
<td>原因</td>
</tr>
<tr>
<td><code>shop_image</code></td>
<td>optional</td>
<td>店铺形象图片</td>
</tr>
<tr>
<td><code>display_show</code></td>
<td>optional</td>
<td>店铺展示图</td>
</tr>
<tr>
<td><code>Business_license</code></td>
<td>optional</td>
<td>营业执照图</td>
</tr>
<tr>
<td><code>food-&amp;gt;classification-&amp;gt;classification</code></td>
<td>optional</td>
<td>对应分类</td>
</tr>
<tr>
<td><code>category-&amp;gt;name</code></td>
<td>optional</td>
<td>对应类目</td>
</tr>
<tr>
<td><code>classification-&amp;gt;class</code></td>
<td>optional</td>
<td>对应商家分类</td>
</tr>
<tr>
<td><code>category-&amp;gt;food</code></td>
<td>optional</td>
<td>对应类目的商品</td>
</tr>
<tr>
<td><code>time_status</code></td>
<td>optional</td>
<td>营业还是打烊 1 营业 0打烊</td>
</tr>
</tbody>
</table>
<!-- END_9b83dae453bd0fe055ce8f8a1c47743b -->
<!-- START_82dd797df26d86d784224adf2c22413f -->
<h2>商家信息修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/business/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"nostrum","user_title":"aut","user_name":"sint","password":"sunt","user_status":14,"phone":"qui","address":"quasi","body":"et","status":12,"consumption":2,"cost":5538393.2,"because":"natus","shop_image":"sequi","display_show":"repudiandae","Business_license":"placeat","classification":15}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "nostrum",
    "user_title": "aut",
    "user_name": "sint",
    "password": "sunt",
    "user_status": 14,
    "phone": "qui",
    "address": "quasi",
    "body": "et",
    "status": 12,
    "consumption": 2,
    "cost": 5538393.2,
    "because": "natus",
    "shop_image": "sequi",
    "display_show": "repudiandae",
    "Business_license": "placeat",
    "classification": 15
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/business/info/{info}</code></p>
<p><code>PATCH api/business/info/{info}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>联系人</td>
</tr>
<tr>
<td><code>user_title</code></td>
<td>string</td>
<td>optional</td>
<td>商家名称</td>
</tr>
<tr>
<td><code>user_name</code></td>
<td>string</td>
<td>optional</td>
<td>账户</td>
</tr>
<tr>
<td><code>password</code></td>
<td>string</td>
<td>optional</td>
<td>密码</td>
</tr>
<tr>
<td><code>user_status</code></td>
<td>integer</td>
<td>optional</td>
<td>账户状态 0禁用 1启用</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>body</code></td>
<td>string</td>
<td>optional</td>
<td>店铺介绍</td>
</tr>
<tr>
<td><code>status</code></td>
<td>integer</td>
<td>optional</td>
<td>店铺状态 0审核中 1正常 2失败</td>
</tr>
<tr>
<td><code>consumption</code></td>
<td>integer</td>
<td>optional</td>
<td>人均消费</td>
</tr>
<tr>
<td><code>cost</code></td>
<td>float</td>
<td>optional</td>
<td>配送费</td>
</tr>
<tr>
<td><code>because</code></td>
<td>string</td>
<td>optional</td>
<td>原因</td>
</tr>
<tr>
<td><code>shop_image</code></td>
<td>string</td>
<td>optional</td>
<td>店铺形象图片</td>
</tr>
<tr>
<td><code>display_show</code></td>
<td>string</td>
<td>optional</td>
<td>店铺展示图  {&quot;0&quot;:{&quot;id&quot;:8}} 删除图片 {&quot;1&quot;:3} 添加图片</td>
</tr>
<tr>
<td><code>Business_license</code></td>
<td>string</td>
<td>optional</td>
<td>营业执照图</td>
</tr>
<tr>
<td><code>classification</code></td>
<td>integer</td>
<td>optional</td>
<td>商家分类id</td>
</tr>
</tbody>
</table>
<!-- END_82dd797df26d86d784224adf2c22413f -->
<!-- START_0f72deee889a7d7fc8f34fae345b56f2 -->
<h2>商家删除(单条)</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/business/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/business/info/{info}</code></p>
<!-- END_0f72deee889a7d7fc8f34fae345b56f2 -->
<!-- START_c9e5a5184e5297d12087295eea15098c -->
<h2>商家删除（多个才传）</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/business/info/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business":"nobis"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business": "nobis"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/business/info/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business</code></td>
<td>json</td>
<td>optional</td>
<td>商家id {&quot;0&quot;:{&quot;id&quot;:23},&quot;1&quot;:{&quot;id&quot;:24}}</td>
</tr>
</tbody>
</table>
<!-- END_c9e5a5184e5297d12087295eea15098c -->
<!-- START_faf2b3cb90e98a8f6dc6f14e92d3620a -->
<h2>商家号是否重复</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/business/info/search" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"user_name":"eum"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info/search"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_name": "eum"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/business/info/search</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>user_name</code></td>
<td>string</td>
<td>optional</td>
<td>账号</td>
</tr>
</tbody>
</table>
<!-- END_faf2b3cb90e98a8f6dc6f14e92d3620a -->
<!-- START_08b66c9dc60786aadedfd675d78cbef8 -->
<h2>商家信息添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/business/info" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"quod","user_title":"aspernatur","user_name":"inventore","password":"ipsam","user_status":"rerum","phone":"quia","address":"suscipit","body":"ut","consumption":7,"shop_image":15,"display_show":7,"Business_license":16,"time":"quis","classification":"in"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/info"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "quod",
    "user_title": "aspernatur",
    "user_name": "inventore",
    "password": "ipsam",
    "user_status": "rerum",
    "phone": "quia",
    "address": "suscipit",
    "body": "ut",
    "consumption": 7,
    "shop_image": 15,
    "display_show": 7,
    "Business_license": 16,
    "time": "quis",
    "classification": "in"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/business/info</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>联系人</td>
</tr>
<tr>
<td><code>user_title</code></td>
<td>string</td>
<td>optional</td>
<td>商家名称</td>
</tr>
<tr>
<td><code>user_name</code></td>
<td>string</td>
<td>optional</td>
<td>账户</td>
</tr>
<tr>
<td><code>password</code></td>
<td>string</td>
<td>required</td>
<td>密码</td>
</tr>
<tr>
<td><code>user_status</code></td>
<td>账户状态</td>
<td>optional</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>body</code></td>
<td>string</td>
<td>optional</td>
<td>店铺介绍</td>
</tr>
<tr>
<td><code>consumption</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 人均消费</td>
</tr>
<tr>
<td><code>shop_image</code></td>
<td>integer</td>
<td>optional</td>
<td>店铺形象图片</td>
</tr>
<tr>
<td><code>display_show</code></td>
<td>integer</td>
<td>optional</td>
<td>店铺展示图</td>
</tr>
<tr>
<td><code>Business_license</code></td>
<td>integer</td>
<td>optional</td>
<td>营业执照图</td>
</tr>
<tr>
<td><code>time</code></td>
<td>{&quot;start_time&quot;:</td>
<td>optional</td>
<td>&quot;9:53:19&quot;,&quot;end_time&quot;: &quot;18:33:01&quot;,&quot;day&quot;: [1,2,3]}</td>
</tr>
<tr>
<td><code>classification</code></td>
<td>json</td>
<td>required</td>
<td>商家分类id  {&quot;0&quot;:2,&quot;1&quot;:6}</td>
</tr>
</tbody>
</table>
<!-- END_08b66c9dc60786aadedfd675d78cbef8 -->
<h1>商家分类</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_5bbc2472c33f68cb5bdf29a71cac1ec7 -->
<h2>商家分类查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/classification?name=et&amp;pid=ab" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"pid":3,"level":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/classification"
);

let params = {
    "name": "et",
    "pid": "ab",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "pid": 3,
    "level": 8
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (500):</p>
</blockquote>
<pre><code class="language-json">{
    "message": "Server Error"
}</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/classification</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>分类名字</td>
</tr>
<tr>
<td><code>pid</code></td>
<td>optional</td>
<td>分类父类</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>pid</code></td>
<td>integer</td>
<td>optional</td>
<td>分类id</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>optional</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_5bbc2472c33f68cb5bdf29a71cac1ec7 -->
<!-- START_f189abbd8156894d505d508bd3c799d8 -->
<h2>商家分类信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/classification/1?name=ut" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"level":4}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/classification/1"
);

let params = {
    "name": "ut",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "level": 4
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (503):</p>
</blockquote>
<pre><code class="language-json">{
    "message": "没有传对应等级分类"
}</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/classification/{classification}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>分类名字</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_f189abbd8156894d505d508bd3c799d8 -->
<!-- START_55804fdf00cc39c84adbe9d6418385ea -->
<h2>商家分类添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/business/classification" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"qui","pid":18,"level":18}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/classification"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "qui",
    "pid": 18,
    "level": 18
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/business/classification</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>分类名字</td>
</tr>
<tr>
<td><code>pid</code></td>
<td>integer</td>
<td>required</td>
<td>分类上级</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_55804fdf00cc39c84adbe9d6418385ea -->
<!-- START_70488d436e98a044be5a601048e4dc07 -->
<h2>商家分类修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/business/classification/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"ut","pid":5,"level":19}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/classification/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "ut",
    "pid": 5,
    "level": 19
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/business/classification/{classification}</code></p>
<p><code>PATCH api/business/classification/{classification}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>分类名字</td>
</tr>
<tr>
<td><code>pid</code></td>
<td>integer</td>
<td>optional</td>
<td>分类上级</td>
</tr>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_70488d436e98a044be5a601048e4dc07 -->
<!-- START_b0b1d6d6063ee095175696f0339eb38d -->
<h2>商家分类删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/business/classification/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"level":16}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/classification/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "level": 16
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/business/classification/{classification}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>level</code></td>
<td>integer</td>
<td>required</td>
<td>分类等级 1 1级分类  2 2级分类 3 3级分类</td>
</tr>
</tbody>
</table>
<!-- END_b0b1d6d6063ee095175696f0339eb38d -->
<h1>商家短信或密码忘记密码逻辑-&gt;验证码短信验证码修改密码模式</h1>
<!-- START_b26ad8bc8e5f67624d89218b6bff3b92 -->
<h2>返回状态码对应消息</h2>
<p>400 参数错误
411 没有提交值
412 没有新密码
413 该商家不存在
414 验证码已经失效 请重新发送
415 验证码错误
416 修改密码失败
200 修改成功</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/forget/business/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":12,"code":3,"pwd":"quis"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/forget/business/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 12,
    "code": 3,
    "pwd": "quis"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/forget/business/token</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>code</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 验证码</td>
</tr>
<tr>
<td><code>pwd</code></td>
<td>string</td>
<td>optional</td>
<td>optional 密码</td>
</tr>
</tbody>
</table>
<!-- END_b26ad8bc8e5f67624d89218b6bff3b92 -->
<h1>商家短信或密码登录逻辑-&gt;优先验证码短信验证码登录模式</h1>
<!-- START_ca6dc312373ff9c11ef63637b45132bc -->
<h2>1. 查看商家是否已经激活</h2>
<ol start="2">
<li>如果是验证码登录 查看验证码的过期没有 再对比掩码</li>
<li>如果是密码登录 对比密码的是否正确</li>
</ol>
<p>返回状态码对应消息</p>
<p>400 参数错误
411 至少需要提交密码或者短信验证码中的一个来验证
412 商家不存在
413 验证码已经失效了 需要重新发送
414 验证码验证失败
415 密码错误
200 登录成功 并且返回的内容是token 可以直接进行会话</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/business/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":10,"code":11,"name":3,"pwd":"esse"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/business/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 10,
    "code": 11,
    "name": 3,
    "pwd": "esse"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/business/token</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>code</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 验证码</td>
</tr>
<tr>
<td><code>name</code></td>
<td>integer</td>
<td>required</td>
<td>账号</td>
</tr>
<tr>
<td><code>pwd</code></td>
<td>string</td>
<td>optional</td>
<td>optional 密码</td>
</tr>
</tbody>
</table>
<!-- END_ca6dc312373ff9c11ef63637b45132bc -->
<h1>商家短信验证码-&gt;忘记密码或登录前发送短信验证码接口</h1>
<!-- START_15cd4d817f890bd10c0e830f015685c7 -->
<h2>返回状态码对应消息</h2>
<p>400 参数错误
411 用户已经被注册了不能发送验证码
412 验证码要在xx间隔之后才能再重新发送
413 没有该商家
200 验证码发送成功 请用户查收</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/business/code" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":10}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/business/code"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 10
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/business/code</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
</tbody>
</table>
<!-- END_15cd4d817f890bd10c0e830f015685c7 -->
<!-- START_4c399b7af5678fa04c47dddfd3e429c4 -->
<h2>返回状态码对应消息</h2>
<p>400 参数错误
411 用户已经被注册了不能发送验证码
412 验证码要在xx间隔之后才能再重新发送
413 没有该商家
200 验证码发送成功 请用户查收</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/admin/code" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":7}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/admin/code"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 7
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/admin/code</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
</tbody>
</table>
<!-- END_4c399b7af5678fa04c47dddfd3e429c4 -->
<h1>商家购物车接口</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_283a82f877a342d017c9f17d9dce7eb9 -->
<h2>商家购物车 用户查看所有购物车情况</h2>
<p>200查询成功</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/business?num=aut&amp;food-%3Ename=error&amp;food-%3Eprice=voluptatum&amp;food-%3Efood_num=magni&amp;id=sunt" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/business"
);

let params = {
    "num": "aut",
    "food-&amp;gt;name": "error",
    "food-&amp;gt;price": "voluptatum",
    "food-&amp;gt;food_num": "magni",
    "id": "sunt",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/business</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>购买商品数量</td>
</tr>
<tr>
<td><code>food-&amp;gt;name</code></td>
<td>optional</td>
<td>商品名</td>
</tr>
<tr>
<td><code>food-&amp;gt;price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>food-&amp;gt;food_num</code></td>
<td>optional</td>
<td>库存</td>
</tr>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>购物车id号</td>
</tr>
</tbody>
</table>
<!-- END_283a82f877a342d017c9f17d9dce7eb9 -->
<!-- START_bc0bbc4407cb051f39c878a9a03021c4 -->
<h2>商家添加或者修改购物车数量</h2>
<p>向用户的购物车中新增商品的功能
前端逻辑
提交商品id号和商品的数量
需要先登录
返回成功的商品数量 商品id 和用户id</p>
<p>权限问题
只有user_type为1的可以使用该接口</p>
<p>200 添加成功
400 请求参数错误
414 服务器错误 添加失败</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/business" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"food":6,"num":12}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/business"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "food": 6,
    "num": 12
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/business</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food</code></td>
<td>integer</td>
<td>required</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>num</code></td>
<td>integer</td>
<td>required</td>
<td>商品数量</td>
</tr>
</tbody>
</table>
<!-- END_bc0bbc4407cb051f39c878a9a03021c4 -->
<!-- START_80a3b8fc3c708b48ae348ee8e7a0f5d2 -->
<h2>商家的所有购物车 用户获取在特定商家中的所有购物车信息 url后的id表示购物车id</h2>
<p>商家的id号和获取商家信息中使用的id号一致</p>
<p>权限问题
只有user_type为1的可以使用该接口
用户本人通过会话获取本人的购物车 无法获取他人的购物车</p>
<p>200 查询成功
414 没有该购物车数据</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/business/1?num=fugiat&amp;food-%3Ename=voluptatem&amp;food-%3Eprice=vel&amp;food-%3Efood_num=voluptatem" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/business/1"
);

let params = {
    "num": "fugiat",
    "food-&amp;gt;name": "voluptatem",
    "food-&amp;gt;price": "vel",
    "food-&amp;gt;food_num": "voluptatem",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/business/{business}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>购买商品数量</td>
</tr>
<tr>
<td><code>food-&amp;gt;name</code></td>
<td>optional</td>
<td>商品名</td>
</tr>
<tr>
<td><code>food-&amp;gt;price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>food-&amp;gt;food_num</code></td>
<td>optional</td>
<td>库存</td>
</tr>
</tbody>
</table>
<!-- END_80a3b8fc3c708b48ae348ee8e7a0f5d2 -->
<!-- START_1eecb24536af31d1777c019552e8ad3c -->
<h2>用户删除购物车 这里是一条一条的删除</h2>
<p>414 没有这个购物车信息 无法删除
200 成功删除</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/order/business/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/business/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/order/business/{business}</code></p>
<!-- END_1eecb24536af31d1777c019552e8ad3c -->
<!-- START_951fb8743e39f7cfcd37e32ca7d88cf5 -->
<h2>用户删除全部购物车</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/business/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business":"fuga"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/business/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business": "fuga"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/business/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business</code></td>
<td>json</td>
<td>required</td>
<td>id号  [1,2,3]</td>
</tr>
</tbody>
</table>
<!-- END_951fb8743e39f7cfcd37e32ca7d88cf5 -->
<h1>地址信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_634253956215e6d39e8631e80ae5ee4f -->
<h2>地址查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/address?address=in&amp;name=qui&amp;phone=culpa" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address"
);

let params = {
    "address": "in",
    "name": "qui",
    "phone": "culpa",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/address</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>address</code></td>
<td>optional</td>
<td>strings 地址信息</td>
</tr>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>string姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>string 电话</td>
</tr>
</tbody>
</table>
<!-- END_634253956215e6d39e8631e80ae5ee4f -->
<!-- START_2a5db25d88bfe3ad1f0f15078e95b57d -->
<h2>地址添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"address":"eaque","name":"rem","phone":"voluptatem"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "address": "eaque",
    "name": "rem",
    "phone": "voluptatem"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/address</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>required</td>
<td>地址信息</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>required</td>
<td>电话</td>
</tr>
</tbody>
</table>
<!-- END_2a5db25d88bfe3ad1f0f15078e95b57d -->
<!-- START_5d8f9cb316e0553a6d774c1c3c19be63 -->
<h2>地址设置为默认</h2>
<p>504 修改失败</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/address/{address}</code></p>
<!-- END_5d8f9cb316e0553a6d774c1c3c19be63 -->
<!-- START_c9cce12035d5db86f0b8ddc26e7dee00 -->
<h2>地址修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/user/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"address":"ea","name":"esse","phone":"dolores"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "address": "ea",
    "name": "esse",
    "phone": "dolores"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/user/address/{address}</code></p>
<p><code>PATCH api/user/address/{address}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>required</td>
<td>地址信息</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>required</td>
<td>电话</td>
</tr>
</tbody>
</table>
<!-- END_c9cce12035d5db86f0b8ddc26e7dee00 -->
<!-- START_e119b6c84f30e78c23281de50f48a82d -->
<h2>地址删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/user/address/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/user/address/{address}</code></p>
<!-- END_e119b6c84f30e78c23281de50f48a82d -->
<!-- START_dff82f19b9edd41b05add208d1c1dbd4 -->
<h2>地址查看单条</h2>
<p>@@queryParam address string 地址信息</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/address/showone?name=maxime&amp;phone=corrupti" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"id":12}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address/showone"
);

let params = {
    "name": "maxime",
    "phone": "corrupti",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 12
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/address/showone</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>string 姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>string 电话</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>integer</td>
<td>required</td>
<td>地址id</td>
</tr>
</tbody>
</table>
<!-- END_dff82f19b9edd41b05add208d1c1dbd4 -->
<!-- START_a02eb4852758b741b6ff95298ea4c351 -->
<h2>默认地址查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/address/showstatus?address=qui&amp;name=libero&amp;phone=quos" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"id":20}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/address/showstatus"
);

let params = {
    "address": "qui",
    "name": "libero",
    "phone": "quos",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 20
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/address/showstatus</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>address</code></td>
<td>optional</td>
<td>string 地址信息</td>
</tr>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>string 姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>string 电话</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>integer</td>
<td>required</td>
<td>地址id</td>
</tr>
</tbody>
</table>
<!-- END_a02eb4852758b741b6ff95298ea4c351 -->
<h1>收藏信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_f23bc10f2a4a3b6d768fb8d2fb2b415b -->
<h2>收藏信息</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/collection?user_id=quas&amp;business_id=eos" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/collection"
);

let params = {
    "user_id": "quas",
    "business_id": "eos",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/collection</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>user_id</code></td>
<td>optional</td>
<td>用户id</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_f23bc10f2a4a3b6d768fb8d2fb2b415b -->
<!-- START_f22ae15f72dd38657f6bad916b712143 -->
<h2>收藏信息添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/collection" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business_id":"vel"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/collection"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business_id": "vel"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/collection</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business_id</code></td>
<td>required</td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_f22ae15f72dd38657f6bad916b712143 -->
<!-- START_7f796e82788ac2b257406723bb327e14 -->
<h2>收藏信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/collection/1?user_id=quis&amp;business_id=aut" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/collection/1"
);

let params = {
    "user_id": "quis",
    "business_id": "aut",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/collection/{collection}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>user_id</code></td>
<td>optional</td>
<td>用户id</td>
</tr>
<tr>
<td><code>business_id</code></td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_7f796e82788ac2b257406723bb327e14 -->
<!-- START_ec348350940bba3e7b2bd53b16ee3e25 -->
<h2>收藏信息修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/user/collection/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business_id":"possimus"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/collection/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business_id": "possimus"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/user/collection/{collection}</code></p>
<p><code>PATCH api/user/collection/{collection}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business_id</code></td>
<td>required</td>
<td>optional</td>
<td>商家id</td>
</tr>
</tbody>
</table>
<!-- END_ec348350940bba3e7b2bd53b16ee3e25 -->
<!-- START_650c195c503b697b3b34921cea33fa88 -->
<h2>收藏信息删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/user/collection/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/collection/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/user/collection/{collection}</code></p>
<!-- END_650c195c503b697b3b34921cea33fa88 -->
<h1>文件传统一接口</h1>
<p>采用 restful api  </p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_134a5329b047bebe42af7de703179a6d -->
<h2>video 2,image 1,audio 3</h2>
<p>请使用post  form-data方式传输图片</p>
<p>返回值</p>
<p>400 参数错误
411 文件处理时发生错误 请联系管理员
500 图片信息存入数据库时发生错误 请联系管理员</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/api/files?local_url=eligendi&amp;local_path=numquam&amp;remote_url=est&amp;tx_url=non&amp;ali_url=fugiat&amp;qiniu_url=tenetur&amp;type=illo&amp;storage_domain=consectetur" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"file":"reprehenderit"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/api/files"
);

let params = {
    "local_url": "eligendi",
    "local_path": "numquam",
    "remote_url": "est",
    "tx_url": "non",
    "ali_url": "fugiat",
    "qiniu_url": "tenetur",
    "type": "illo",
    "storage_domain": "consectetur",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "file": "reprehenderit"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/api/files</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>local_url</code></td>
<td>optional</td>
<td>文件上传保存在服务器的url</td>
</tr>
<tr>
<td><code>local_path</code></td>
<td>optional</td>
<td>文件上传保存在服务器的位置</td>
</tr>
<tr>
<td><code>remote_url</code></td>
<td>optional</td>
<td>文件上传保存在远程服务器的url</td>
</tr>
<tr>
<td><code>tx_url</code></td>
<td>optional</td>
<td>文件上传保存在腾讯服务器的url</td>
</tr>
<tr>
<td><code>ali_url</code></td>
<td>optional</td>
<td>文件上传保存在阿里服务器的url</td>
</tr>
<tr>
<td><code>qiniu_url</code></td>
<td>optional</td>
<td>文件上传保存在七牛服务器的url</td>
</tr>
<tr>
<td><code>type</code></td>
<td>optional</td>
<td>文件类型 video 2,image 1,audio 3</td>
</tr>
<tr>
<td><code>storage_domain</code></td>
<td>optional</td>
<td>文件访问的域名 如果返回的是文件访问的相对路径 可以用来拼接成url访问资源</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>file</code></td>
<td>file</td>
<td>required</td>
<td>传输的文件 请保证文件只能是 minetype中 audio image 类型,不支持-&gt;txt等文件</td>
</tr>
</tbody>
</table>
<!-- END_134a5329b047bebe42af7de703179a6d -->
<h1>消息推送接口</h1>
<p>消息推送使用websocket协议推送
下面有一个websocket测试页面,页面已经连接服务器用于演示</p>
<!-- START_ad6ce6078f7478ea761f9aaacd252d17 -->
<h2>ws测试页面</h2>
<p>具体文档地址
<a href="https://gitee.com/moist-master/xjws/blob/master/READMEWS.md">https://gitee.com/moist-master/xjws/blob/master/READMEWS.md</a></p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/ws/index" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/ws/index"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (200):</p>
</blockquote>
<pre><code class="language-json">null</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/ws/index</code></p>
<!-- END_ad6ce6078f7478ea761f9aaacd252d17 -->
<h1>用户信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_1cf9d677dadd7b751523d1b871857f9c -->
<h2>用户信息添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/info" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"est","password":"saepe","phone":"veniam","card":2,"hospital_id":12,"register_id":12,"carte_card":11,"medical_card":15,"image":"aut","family_name":"fugit","family_phone":"id","family_wechat":"commodi","address":"sunt"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "est",
    "password": "saepe",
    "phone": "veniam",
    "card": 2,
    "hospital_id": 12,
    "register_id": 12,
    "carte_card": 11,
    "medical_card": 15,
    "image": "aut",
    "family_name": "fugit",
    "family_phone": "id",
    "family_wechat": "commodi",
    "address": "sunt"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/info</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>姓名</td>
</tr>
<tr>
<td><code>password</code></td>
<td>string</td>
<td>required</td>
<td>密码</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>card</code></td>
<td>integer</td>
<td>required</td>
<td>身份证</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>integer</td>
<td>required</td>
<td>住院号</td>
</tr>
<tr>
<td><code>register_id</code></td>
<td>integer</td>
<td>required</td>
<td>登记号</td>
</tr>
<tr>
<td><code>carte_card</code></td>
<td>integer</td>
<td>required</td>
<td>用户社保卡</td>
</tr>
<tr>
<td><code>medical_card</code></td>
<td>integer</td>
<td>required</td>
<td>用户就诊卡</td>
</tr>
<tr>
<td><code>image</code></td>
<td>string</td>
<td>required</td>
<td>头像</td>
</tr>
<tr>
<td><code>family_name</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属姓名</td>
</tr>
<tr>
<td><code>family_phone</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属电话</td>
</tr>
<tr>
<td><code>family_wechat</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属微信号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>json</td>
<td>optional</td>
<td>地址  [{&quot;address&quot;: &quot;长111沙11区&quot;},{&quot;address&quot;:&quot;s2adfx&quot;}]</td>
</tr>
</tbody>
</table>
<!-- END_1cf9d677dadd7b751523d1b871857f9c -->
<!-- START_adac9e88740374a336aed72c417ac24b -->
<h2>用户信息查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/info?name=dicta&amp;phone=non&amp;card=quo&amp;hospital_id=incidunt&amp;carte_card=commodi&amp;medical_card=libero&amp;register_id=at&amp;address-%3Eaddress-%3Eaddress=qui&amp;image=excepturi&amp;family_name=cum&amp;family_phone=explicabo&amp;family_wechat=qui" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"search":"ut","address":"id","hospital_id":11,"card":16}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info"
);

let params = {
    "name": "dicta",
    "phone": "non",
    "card": "quo",
    "hospital_id": "incidunt",
    "carte_card": "commodi",
    "medical_card": "libero",
    "register_id": "at",
    "address-&amp;gt;address-&amp;gt;address": "qui",
    "image": "excepturi",
    "family_name": "cum",
    "family_phone": "explicabo",
    "family_wechat": "qui",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "search": "ut",
    "address": "id",
    "hospital_id": 11,
    "card": 16
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/info</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>card</code></td>
<td>optional</td>
<td>身份证</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>optional</td>
<td>住院号</td>
</tr>
<tr>
<td><code>carte_card</code></td>
<td>optional</td>
<td>用户社保卡</td>
</tr>
<tr>
<td><code>medical_card</code></td>
<td>optional</td>
<td>用户就诊卡</td>
</tr>
<tr>
<td><code>register_id</code></td>
<td>optional</td>
<td>登记号</td>
</tr>
<tr>
<td><code>address-&amp;gt;address-&amp;gt;address</code></td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>image</code></td>
<td>optional</td>
<td>图片</td>
</tr>
<tr>
<td><code>family_name</code></td>
<td>optional</td>
<td>用户家属姓名</td>
</tr>
<tr>
<td><code>family_phone</code></td>
<td>optional</td>
<td>用户家属电话</td>
</tr>
<tr>
<td><code>family_wechat</code></td>
<td>optional</td>
<td>用户家属微信号</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>search</code></td>
<td>string</td>
<td>optional</td>
<td>姓名</td>
</tr>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>integer</td>
<td>optional</td>
<td>住院号</td>
</tr>
<tr>
<td><code>card</code></td>
<td>integer</td>
<td>optional</td>
<td>身份证号</td>
</tr>
</tbody>
</table>
<!-- END_adac9e88740374a336aed72c417ac24b -->
<!-- START_0f2d1174b928d74fb7fa004ea1f0b758 -->
<h2>用户信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/user/info/1?name=mollitia&amp;phone=qui&amp;card=iste&amp;hospital_id=qui&amp;carte_card=dolor&amp;medical_card=incidunt&amp;register_id=atque&amp;address-%3Eaddress-%3Eaddress=et&amp;image=voluptatibus&amp;family_name=et&amp;family_phone=qui&amp;family_wechat=sit&amp;collection=eum" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info/1"
);

let params = {
    "name": "mollitia",
    "phone": "qui",
    "card": "iste",
    "hospital_id": "qui",
    "carte_card": "dolor",
    "medical_card": "incidunt",
    "register_id": "atque",
    "address-&amp;gt;address-&amp;gt;address": "et",
    "image": "voluptatibus",
    "family_name": "et",
    "family_phone": "qui",
    "family_wechat": "sit",
    "collection": "eum",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/user/info/{info}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>card</code></td>
<td>optional</td>
<td>身份证</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>optional</td>
<td>住院号</td>
</tr>
<tr>
<td><code>carte_card</code></td>
<td>optional</td>
<td>用户社保卡</td>
</tr>
<tr>
<td><code>medical_card</code></td>
<td>optional</td>
<td>用户就诊卡</td>
</tr>
<tr>
<td><code>register_id</code></td>
<td>optional</td>
<td>登记号</td>
</tr>
<tr>
<td><code>address-&amp;gt;address-&amp;gt;address</code></td>
<td>optional</td>
<td>地址</td>
</tr>
<tr>
<td><code>image</code></td>
<td>optional</td>
<td>图片</td>
</tr>
<tr>
<td><code>family_name</code></td>
<td>optional</td>
<td>用户家属姓名</td>
</tr>
<tr>
<td><code>family_phone</code></td>
<td>optional</td>
<td>用户家属电话</td>
</tr>
<tr>
<td><code>family_wechat</code></td>
<td>optional</td>
<td>用户家属微信号</td>
</tr>
<tr>
<td><code>collection</code></td>
<td>optional</td>
<td>用户收藏</td>
</tr>
</tbody>
</table>
<!-- END_0f2d1174b928d74fb7fa004ea1f0b758 -->
<!-- START_9784558e9f831f63aa257c493f26a164 -->
<h2>用户信息修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/user/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"sapiente","password":"dolores","phone":"nesciunt","card":19,"hospital_id":8,"register_id":6,"carte_card":15,"medical_card":19,"image":"eius","family_name":"quia","family_phone":"nisi","family_wechat":"corrupti","address":"quod","Collection":"natus"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "sapiente",
    "password": "dolores",
    "phone": "nesciunt",
    "card": 19,
    "hospital_id": 8,
    "register_id": 6,
    "carte_card": 15,
    "medical_card": 19,
    "image": "eius",
    "family_name": "quia",
    "family_phone": "nisi",
    "family_wechat": "corrupti",
    "address": "quod",
    "Collection": "natus"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/user/info/{info}</code></p>
<p><code>PATCH api/user/info/{info}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>姓名</td>
</tr>
<tr>
<td><code>password</code></td>
<td>string</td>
<td>optional</td>
<td>密码</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>optional</td>
<td>手机号</td>
</tr>
<tr>
<td><code>card</code></td>
<td>integer</td>
<td>optional</td>
<td>身份证</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>integer</td>
<td>optional</td>
<td>住院号</td>
</tr>
<tr>
<td><code>register_id</code></td>
<td>integer</td>
<td>optional</td>
<td>登记号</td>
</tr>
<tr>
<td><code>carte_card</code></td>
<td>integer</td>
<td>optional</td>
<td>用户社保卡</td>
</tr>
<tr>
<td><code>medical_card</code></td>
<td>integer</td>
<td>optional</td>
<td>用户就诊卡</td>
</tr>
<tr>
<td><code>image</code></td>
<td>string</td>
<td>optional</td>
<td>头像</td>
</tr>
<tr>
<td><code>family_name</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属姓名</td>
</tr>
<tr>
<td><code>family_phone</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属电话</td>
</tr>
<tr>
<td><code>family_wechat</code></td>
<td>string</td>
<td>optional</td>
<td>用户家属微信号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>json地址</td>
<td>optional</td>
</tr>
<tr>
<td><code>Collection</code></td>
<td>json</td>
<td>optional</td>
<td>收藏</td>
</tr>
</tbody>
</table>
<!-- END_9784558e9f831f63aa257c493f26a164 -->
<!-- START_06badc09f9ade4e3440c09e3186643a5 -->
<h2>用户信息删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/user/info/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/user/info/{info}</code></p>
<!-- END_06badc09f9ade4e3440c09e3186643a5 -->
<!-- START_f811e268a280c3405bad074f7c905efa -->
<h2>用户删除（多个）</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/user/info/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"user_id":"corrupti"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/user/info/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_id": "corrupti"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/user/info/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>user_id</code></td>
<td>json</td>
<td>required</td>
<td>用户id {&quot;0&quot;:{&quot;id&quot;:23},&quot;1&quot;:{&quot;id&quot;:24}}</td>
</tr>
</tbody>
</table>
<!-- END_f811e268a280c3405bad074f7c905efa -->
<h1>用户查看当前可用优惠券接口</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_1ba4dff3b2a2ed868236f0844f4d0185 -->
<h2>优惠券信息查看接口:分两类人查看</h2>
<ol>
<li>后台管理员查看所有代金券的信息</li>
<li>用户查看本用户的代金券信息</li>
</ol>
<p>200 数据访问成功
400 参数错误
414 不存在的用户在访问该接口</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/bonus/current?id=similique&amp;record_id=ipsum&amp;type=dicta&amp;no=reprehenderit&amp;fee=aliquid" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/bonus/current"
);

let params = {
    "id": "similique",
    "record_id": "ipsum",
    "type": "dicta",
    "no": "reprehenderit",
    "fee": "aliquid",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/bonus/current</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>可用优惠券id号 提交订单使使用这个id号</td>
</tr>
<tr>
<td><code>record_id</code></td>
<td>optional</td>
<td>优惠券历史记录id号</td>
</tr>
<tr>
<td><code>type</code></td>
<td>optional</td>
<td>1 2 3对应 A B C三类优惠券</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>优惠券编号</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>抵扣金额</td>
</tr>
</tbody>
</table>
<!-- END_1ba4dff3b2a2ed868236f0844f4d0185 -->
<!-- START_43b542d9f8adcd1b492548f5063dce93 -->
<h2>单个优惠券信息查看接口:分两类人查看</h2>
<ol>
<li>后台管理员查看所有代金券的信息</li>
<li>用户查看本用户的代金券信息</li>
</ol>
<p>200 数据访问成功
400 参数错误
414 不存在的用户在访问该接口</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/bonus/current/1?id=iusto&amp;record_id=laboriosam&amp;type=aut&amp;no=quaerat&amp;fee=sed" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/bonus/current/1"
);

let params = {
    "id": "iusto",
    "record_id": "laboriosam",
    "type": "aut",
    "no": "quaerat",
    "fee": "sed",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/bonus/current/{current}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>可用优惠券id号 提交订单使使用这个id号</td>
</tr>
<tr>
<td><code>record_id</code></td>
<td>optional</td>
<td>优惠券历史记录id号</td>
</tr>
<tr>
<td><code>type</code></td>
<td>optional</td>
<td>1 2 3对应 A B C三类优惠券</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>优惠券编号</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>抵扣金额</td>
</tr>
</tbody>
</table>
<!-- END_43b542d9f8adcd1b492548f5063dce93 -->
<h1>用户查看所有优惠券接口</h1>
<p>采用 restful api  </p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_69adc13d6ac6f702608cc09aecd3f11f -->
<h2>优惠券信息查看接口:分两类人查看</h2>
<ol>
<li>后台管理员查看所有代金券的信息</li>
<li>用户查看本用户的代金券信息</li>
</ol>
<p>200 数据访问成功
400 参数错误
414 不存在的用户在访问该接口</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/bonus/record?id=nihil&amp;record_id=voluptates&amp;type=qui&amp;no=quibusdam&amp;fee=rem" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"is_used":false}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/bonus/record"
);

let params = {
    "id": "nihil",
    "record_id": "voluptates",
    "type": "qui",
    "no": "quibusdam",
    "fee": "rem",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "is_used": false
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/bonus/record</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>可用优惠券id号 提交订单使使用这个id号</td>
</tr>
<tr>
<td><code>record_id</code></td>
<td>optional</td>
<td>优惠券历史记录id号</td>
</tr>
<tr>
<td><code>type</code></td>
<td>optional</td>
<td>1 2 3对应 A B C三类优惠券</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>优惠券编号</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>抵扣金额</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>is_used</code></td>
<td>boolean</td>
<td>optional</td>
<td>optional 过滤已使用或者未使用的优惠券</td>
</tr>
</tbody>
</table>
<!-- END_69adc13d6ac6f702608cc09aecd3f11f -->
<!-- START_8ad777515e415b34286e029d4cf108c4 -->
<h2>单个优惠券信息查看接口:分两类人查看</h2>
<ol>
<li>后台管理员查看所有代金券的信息</li>
<li>用户查看本用户的代金券信息</li>
</ol>
<p>200 数据访问成功
400 参数错误
414 不存在的用户在访问该接口</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/bonus/record/1?id=ipsa&amp;record_id=optio&amp;type=exercitationem&amp;no=ullam&amp;fee=veniam" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/bonus/record/1"
);

let params = {
    "id": "ipsa",
    "record_id": "optio",
    "type": "exercitationem",
    "no": "ullam",
    "fee": "veniam",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/bonus/record/{record}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>可用优惠券id号 提交订单使使用这个id号</td>
</tr>
<tr>
<td><code>record_id</code></td>
<td>optional</td>
<td>优惠券历史记录id号</td>
</tr>
<tr>
<td><code>type</code></td>
<td>optional</td>
<td>1 2 3对应 A B C三类优惠券</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>优惠券编号</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>抵扣金额</td>
</tr>
</tbody>
</table>
<!-- END_8ad777515e415b34286e029d4cf108c4 -->
<h1>用户添加删除</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_a0dbe7236fbae2240312e6ae5e2cbf72 -->
<h2>用户添加</h2>
<p>200 数据访问成功
400 参数错误
504 添加失败
503 有重复的手机号</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/sys/user/store" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"amet","card":"architecto","carte_card":20,"medical_card":7,"hospital_id":17,"register_id":14,"phone":8,"password":16}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/sys/user/store"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "amet",
    "card": "architecto",
    "carte_card": 20,
    "medical_card": 7,
    "hospital_id": 17,
    "register_id": 14,
    "phone": 8,
    "password": 16
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/sys/user/store</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>用户姓名</td>
</tr>
<tr>
<td><code>card</code></td>
<td>string</td>
<td>required</td>
<td>用户身份证号</td>
</tr>
<tr>
<td><code>carte_card</code></td>
<td>integer</td>
<td>required</td>
<td>用户社保卡</td>
</tr>
<tr>
<td><code>medical_card</code></td>
<td>integer</td>
<td>required</td>
<td>用户就诊卡</td>
</tr>
<tr>
<td><code>hospital_id</code></td>
<td>integer</td>
<td>required</td>
<td>用户住院号</td>
</tr>
<tr>
<td><code>register_id</code></td>
<td>integer</td>
<td>required</td>
<td>登记号</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>password</code></td>
<td>integer</td>
<td>required</td>
<td>密码</td>
</tr>
</tbody>
</table>
<!-- END_a0dbe7236fbae2240312e6ae5e2cbf72 -->
<!-- START_d328d1923b0c3ee19db5348ea136d1ab -->
<h2>用户删除</h2>
<p>200 数据访问成功
404 没有对应信息
500 删除失败</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/sys/user/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":"itaque"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/sys/user/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": "itaque"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/sys/user/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>required</td>
<td>用户手机号</td>
</tr>
</tbody>
</table>
<!-- END_d328d1923b0c3ee19db5348ea136d1ab -->
<h1>用户短信登录或注册</h1>
<!-- START_a85df5cdb714697258e6450f8907f89a -->
<h2>前端逻辑</h2>
<ol>
<li>
<p>首先调用auth/message/code获取短信验证码</p>
</li>
<li>
<p>调用该接口注册或登录</p>
</li>
<li>
<p>注册成功或登录成功都会返回一串token</p>
</li>
<li>
<p>把这一串token加在http headers中 key是Authorization value是返回的这一串token</p>
</li>
<li>
<p>返回res说明 info是用户信息dict格式 token是会话 把这一串token加在http headers中 key是Authorization value是返回的这一串token</p>
</li>
<li>
<p>name-&gt;姓名</p>
</li>
<li>
<p>id-&gt;用户id号</p>
</li>
<li>
<p>phone-&gt;用户手机号</p>
</li>
<li>
<p>card-&gt;用户身份证号</p>
</li>
<li>
<p>address-&gt;用户地址管理 json格式</p>
</li>
<li>
<p>hospital_id-&gt;住院号</p>
</li>
<li>
<p>register_id-&gt;登记号</p>
</li>
<li>
<p>avatar-&gt;头像url信息 json格式</p>
</li>
<li>
<p>bonus-&gt;餐券json格式
fee-&gt;(&#039;优惠金额&#039;);
type-&gt;1:A 2:B 3:C三种类型</p>
</li>
<li>
<p>collection-&gt;收藏json格式</p>
</li>
</ol>
<p>后端逻辑</p>
<ol>
<li>查看用户是否已经激活 判断类型 未激活是注册逻辑 激活是登录逻辑</li>
<li>查看验证码是否过期</li>
<li>对比验证码是否正确</li>
<li>如果是注册添加一个新用户</li>
<li>发送token给前端页面</li>
</ol>
<p>返回状态码对应消息</p>
<p>400 参数错误
411 至少需要提交密码或者短信验证码中的一个来验证
412 用户还没有注册成功 要先执行获取短信验证码
413 验证码已经失效了 需要重新发送
414 验证码验证失败</p>
<p>200 注册成功 并且返回的内容是token 可以直接进行会话</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/user/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":2,"code":6}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/user/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 2,
    "code": 6
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/user/token</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>code</code></td>
<td>integer</td>
<td>required</td>
<td>验证码</td>
</tr>
</tbody>
</table>
<!-- END_a85df5cdb714697258e6450f8907f89a -->
<h1>用户短信验证码-&gt;注册账户或登录前发送短信验证码接口</h1>
<!-- START_ed885e753f67b5e170f038e24536b157 -->
<h2>后端逻辑</h2>
<ol>
<li>首先查看用户手机号是否存在 不存在就生成一个新用户</li>
<li>如果这个用户已经激活就不发送激活验证码了 转到步骤5</li>
<li>首先查看用户验证码是否在最近发送过 如果发送时间间隔小于设定的值 则提示用户等会再试</li>
<li>发送验证码 插入数据库 记录验证码发送时间</li>
<li>这一步说明用户是想获取登录验证码 首先验证码登录验证码是否发送期有效 提示还需要过xx秒才能发送验证码</li>
<li>最后一次发送时间无效则发送登录验证码</li>
</ol>
<p>返回状态码对应消息</p>
<p>400 参数错误
411 用户已经被注册了不能发送验证码
412 验证码要在xx间隔之后才能再重新发送
200 验证码发送成功 请用户查收</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/auth/message/code" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"phone":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/auth/message/code"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "phone": 8
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/auth/message/code</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
</tbody>
</table>
<!-- END_ed885e753f67b5e170f038e24536b157 -->
<h1>管理员添加删除</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_dfb0d56c944153e6ecef2d9b9f98fb19 -->
<h2>管理员添加</h2>
<p>200 数据访问成功
400 参数错误
503 已经有账号</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/sys/admin/store" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":5,"phone":20,"number":12,"password":4}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/sys/admin/store"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": 5,
    "phone": 20,
    "number": 12,
    "password": 4
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/sys/admin/store</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>integer</td>
<td>required</td>
<td>名称</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>integer</td>
<td>required</td>
<td>手机号</td>
</tr>
<tr>
<td><code>number</code></td>
<td>integer</td>
<td>required</td>
<td>账号</td>
</tr>
<tr>
<td><code>password</code></td>
<td>integer</td>
<td>required</td>
<td>密码</td>
</tr>
</tbody>
</table>
<!-- END_dfb0d56c944153e6ecef2d9b9f98fb19 -->
<!-- START_03adceb94025d1222632b7237ff5f238 -->
<h2>管理员删除</h2>
<p>200 数据访问成功
400 参数错误
414 不存在的用户在访问该接口</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/sys/admin/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"number":12}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/sys/admin/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "number": 12
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/sys/admin/delete</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>number</code></td>
<td>integer</td>
<td>required</td>
<td>账号</td>
</tr>
</tbody>
</table>
<!-- END_03adceb94025d1222632b7237ff5f238 -->
<h1>类目信息</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_04eb28bc5188449deff3f5e76aadb435 -->
<h2>类目信息查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/category?name=accusamus&amp;food=quis&amp;food-%E3%80%8Bbusiness=esse" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/category"
);

let params = {
    "name": "accusamus",
    "food": "quis",
    "food-》business": "esse",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/category</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>类目名字</td>
</tr>
<tr>
<td><code>food</code></td>
<td>optional</td>
<td>类目下食品</td>
</tr>
<tr>
<td><code>food-》business</code></td>
<td>optional</td>
<td>类目下食品对应商家</td>
</tr>
</tbody>
</table>
<!-- END_04eb28bc5188449deff3f5e76aadb435 -->
<!-- START_294ba06eb0846613c63fd40b6ab1d2e7 -->
<h2>类目添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/food/category" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"dolorem"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/category"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "dolorem"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/food/category</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>类目名字</td>
</tr>
</tbody>
</table>
<!-- END_294ba06eb0846613c63fd40b6ab1d2e7 -->
<!-- START_9ab75609c09359eddb24f6fd856e54c9 -->
<h2>类目信息查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/food/category/1?name=qui&amp;food=exercitationem&amp;food-%E3%80%8Bbusiness=sit" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business":10}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/category/1"
);

let params = {
    "name": "qui",
    "food": "exercitationem",
    "food-》business": "sit",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business": 10
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/food/category/{category}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>类目名字</td>
</tr>
<tr>
<td><code>food</code></td>
<td>optional</td>
<td>类目下食品</td>
</tr>
<tr>
<td><code>food-》business</code></td>
<td>optional</td>
<td>类目下食品对应商家</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business</code></td>
<td>integer</td>
<td>optional</td>
<td>对应商家id</td>
</tr>
</tbody>
</table>
<!-- END_9ab75609c09359eddb24f6fd856e54c9 -->
<!-- START_b006072213f6910d7981f003cd3974bb -->
<h2>类目修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/food/category/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"voluptatem"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "voluptatem"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/food/category/{category}</code></p>
<p><code>PATCH api/food/category/{category}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>required</td>
<td>类目名字</td>
</tr>
</tbody>
</table>
<!-- END_b006072213f6910d7981f003cd3974bb -->
<!-- START_739265369101e029a11f6fe180829c81 -->
<h2>商品分类删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/food/category/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/food/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/food/category/{category}</code></p>
<!-- END_739265369101e029a11f6fe180829c81 -->
<h1>营业时间</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_a3b181fb92718b19fdd5f0d811c3228c -->
<h2>营业时间查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/time?start_time=officia&amp;end_time=est&amp;day=et&amp;business-%E3%80%8Buser_title=omnis" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/time"
);

let params = {
    "start_time": "officia",
    "end_time": "est",
    "day": "et",
    "business-》user_title": "omnis",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/time</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>start_time</code></td>
<td>optional</td>
<td>开始时间</td>
</tr>
<tr>
<td><code>end_time</code></td>
<td>optional</td>
<td>结束时间</td>
</tr>
<tr>
<td><code>day</code></td>
<td>optional</td>
<td>星期 1: 星期一 2: 星期二 3: 星期三 .. 0: 星期天</td>
</tr>
<tr>
<td><code>business-》user_title</code></td>
<td>optional</td>
<td>商家名称</td>
</tr>
</tbody>
</table>
<!-- END_a3b181fb92718b19fdd5f0d811c3228c -->
<!-- START_d4cf6f8e0f329117e8fbf2eef457dd10 -->
<h2>营业时间添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/business/time" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"start_time":"ut","end_time":"ea","day":"pariatur"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/time"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "start_time": "ut",
    "end_time": "ea",
    "day": "pariatur"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/business/time</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>start_time</code></td>
<td>开始时间</td>
<td>optional</td>
</tr>
<tr>
<td><code>end_time</code></td>
<td>结束时间</td>
<td>optional</td>
</tr>
<tr>
<td><code>day</code></td>
<td>日期</td>
<td>optional</td>
<td>503 添加失败</td>
</tr>
</tbody>
</table>
<!-- END_d4cf6f8e0f329117e8fbf2eef457dd10 -->
<!-- START_a0f7707a1caeb9e4568de7b202618dc8 -->
<h2>营业时间查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/business/time/1?start_time=quia&amp;end_time=enim&amp;day=corporis&amp;business-%E3%80%8Buser_title=earum" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/time/1"
);

let params = {
    "start_time": "quia",
    "end_time": "enim",
    "day": "corporis",
    "business-》user_title": "earum",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/business/time/{time}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>start_time</code></td>
<td>optional</td>
<td>开始时间</td>
</tr>
<tr>
<td><code>end_time</code></td>
<td>optional</td>
<td>结束时间</td>
</tr>
<tr>
<td><code>day</code></td>
<td>optional</td>
<td>星期 1: 星期一 2: 星期二 3: 星期三 .. 0: 星期天</td>
</tr>
<tr>
<td><code>business-》user_title</code></td>
<td>optional</td>
<td>商家名称</td>
</tr>
</tbody>
</table>
<!-- END_a0f7707a1caeb9e4568de7b202618dc8 -->
<!-- START_88dbaeef73c4ba24a811fa8919b05990 -->
<h2>营业时间修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/business/time/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business_id":19,"start_time":"molestiae","end_time":"sapiente"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/time/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business_id": 19,
    "start_time": "molestiae",
    "end_time": "sapiente"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/business/time/{time}</code></p>
<p><code>PATCH api/business/time/{time}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business_id</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 商家id</td>
</tr>
<tr>
<td><code>start_time</code></td>
<td>Time</td>
<td>required</td>
<td>开始时间</td>
</tr>
<tr>
<td><code>end_time</code></td>
<td>Time</td>
<td>required</td>
<td>结束时间</td>
</tr>
</tbody>
</table>
<!-- END_88dbaeef73c4ba24a811fa8919b05990 -->
<!-- START_cdc9c6190191f43d6af2aa528466ee61 -->
<h2>营业时间删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/business/time/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/business/time/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/business/time/{time}</code></p>
<!-- END_cdc9c6190191f43d6af2aa528466ee61 -->
<h1>订单失败原因查看</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_e414f5cc6b9b67ab671adae930a47892 -->
<h2>订单失败原因查看</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/because?name=qui" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/because"
);

let params = {
    "name": "qui",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (200):</p>
</blockquote>
<pre><code class="language-json">[
    {
        "id": 1,
        "name": "商品没选完",
        "created_at": null,
        "updated_at": null
    },
    {
        "id": 2,
        "name": "商品点多了",
        "created_at": null,
        "updated_at": null
    },
    {
        "id": 3,
        "name": "不想要了",
        "created_at": null,
        "updated_at": null
    },
    {
        "id": 4,
        "name": "其他",
        "created_at": null,
        "updated_at": null
    }
]</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/because</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>订单失败原因</td>
</tr>
</tbody>
</table>
<!-- END_e414f5cc6b9b67ab671adae930a47892 -->
<!-- START_7256511742c6b2957c357cf53748133f -->
<h2>订单失败原因查看单条</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/because/1?name=voluptate" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/because/1"
);

let params = {
    "name": "voluptate",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (200):</p>
</blockquote>
<pre><code class="language-json">{
    "id": 1,
    "name": "商品没选完",
    "created_at": null,
    "updated_at": null
}</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/because/{because}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>optional</td>
<td>订单失败原因</td>
</tr>
</tbody>
</table>
<!-- END_7256511742c6b2957c357cf53748133f -->
<!-- START_09a53c0fef039240bb8d063ea6f4b54a -->
<h2>订单失败原因添加</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/because" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"distinctio"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/because"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "distinctio"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/because</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>required</td>
<td>optional</td>
<td>订单失败原因</td>
</tr>
</tbody>
</table>
<!-- END_09a53c0fef039240bb8d063ea6f4b54a -->
<!-- START_1225a3a136a9e7d5bd67f7925cf7a836 -->
<h2>订单失败原因修改</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/order/because/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"eveniet"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/because/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "eveniet"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/order/because/{because}</code></p>
<p><code>PATCH api/order/because/{because}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>required</td>
<td>optional</td>
<td>订单失败原因</td>
</tr>
</tbody>
</table>
<!-- END_1225a3a136a9e7d5bd67f7925cf7a836 -->
<!-- START_8f1ccbad0c4a9c2969f2c5757d3692e3 -->
<h2>订单失败原因删除</h2>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/order/because/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/because/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/order/because/{because}</code></p>
<!-- END_8f1ccbad0c4a9c2969f2c5757d3692e3 -->
<h1>订单接口</h1>
<p>采用 restful api</p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_d98dfd37b721bf731d886cbc5c8bb641 -->
<h2>订单查看接口,用户只能查看自己的订单,商户可以查看商户上面所有的订单,管理员可以查看所有订单</h2>
<p>返回值</p>
<p>400 参数错误
前端逻辑 该接口分三类用户使用</p>
<ol>
<li>用于只能看自己的订单</li>
<li>商家只能看属于商家的订单</li>
<li>后台管理员可以看所有的订单</li>
</ol>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/order?id=vel&amp;no=quia&amp;total_fee=reiciendis&amp;fee=eum&amp;bonus_fee=nihil&amp;pay_status=ducimus&amp;trans_status=hic&amp;status=ab&amp;accept=optio&amp;is_confirm=deserunt&amp;is_revoke=cupiditate&amp;active=vel&amp;order_goods=quae&amp;order_goods-%3Enum=in&amp;order_goods-%3Eprice=facere&amp;order_goods-%3Egoods=repudiandae&amp;business=est" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"no":"qui","phone":"ducimus","bonus":"ducimus","name":"rerum","date":"quia","accept":7,"status":8}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/order"
);

let params = {
    "id": "vel",
    "no": "quia",
    "total_fee": "reiciendis",
    "fee": "eum",
    "bonus_fee": "nihil",
    "pay_status": "ducimus",
    "trans_status": "hic",
    "status": "ab",
    "accept": "optio",
    "is_confirm": "deserunt",
    "is_revoke": "cupiditate",
    "active": "vel",
    "order_goods": "quae",
    "order_goods-&amp;gt;num": "in",
    "order_goods-&amp;gt;price": "facere",
    "order_goods-&amp;gt;goods": "repudiandae",
    "business": "est",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "no": "qui",
    "phone": "ducimus",
    "bonus": "ducimus",
    "name": "rerum",
    "date": "quia",
    "accept": 7,
    "status": 8
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/order</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>订单主键</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>订单流水号</td>
</tr>
<tr>
<td><code>total_fee</code></td>
<td>optional</td>
<td>订单总金额</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>订单实际金额</td>
</tr>
<tr>
<td><code>bonus_fee</code></td>
<td>optional</td>
<td>优惠金额</td>
</tr>
<tr>
<td><code>pay_status</code></td>
<td>optional</td>
<td>支付状态 0 1 未支付 已支付</td>
</tr>
<tr>
<td><code>trans_status</code></td>
<td>optional</td>
<td>运送状态 1.未配送 2.配送中 3. 配送完成</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>订单状态 false.未完成 true.订单完成</td>
</tr>
<tr>
<td><code>accept</code></td>
<td>optional</td>
<td>商家是否接单 false:未接单 true:已接单 2:已拒单</td>
</tr>
<tr>
<td><code>is_confirm</code></td>
<td>optional</td>
<td>用户是否已经确定下单</td>
</tr>
<tr>
<td><code>is_revoke</code></td>
<td>optional</td>
<td>用户撤销的订单 撤销的订单就无用了</td>
</tr>
<tr>
<td><code>active</code></td>
<td>optional</td>
<td>订单是否正式被撤销 1 正常状态 0被撤销</td>
</tr>
<tr>
<td><code>order_goods</code></td>
<td>optional</td>
<td>数组表示订单中的购买商品情况 （数组）</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;num</code></td>
<td>optional</td>
<td>该商品购买数量</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;price</code></td>
<td>optional</td>
<td>该商品下单的时候的单价</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;goods</code></td>
<td>optional</td>
<td>该商品的详细信息 具体字段和商品信息一模一样</td>
</tr>
<tr>
<td><code>business</code></td>
<td>optional</td>
<td>商家信息 字段说明和商家信息接口一模一样</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>no</code></td>
<td>string</td>
<td>optional</td>
<td>optional 通过订单号模糊查询订单</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>optional</td>
<td>optional 通过手机号模糊查询订单</td>
</tr>
<tr>
<td><code>bonus</code></td>
<td>string</td>
<td>optional</td>
<td>optional 通过代金券编号查询订单</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>optional 通过用户姓名查询订单</td>
</tr>
<tr>
<td><code>date</code></td>
<td>string</td>
<td>optional</td>
<td>optional 通过消费日期查询订单</td>
</tr>
<tr>
<td><code>accept</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 商家是否接单</td>
</tr>
<tr>
<td><code>status</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 订单是否完成</td>
</tr>
</tbody>
</table>
<!-- END_d98dfd37b721bf731d886cbc5c8bb641 -->
<!-- START_466aaccf34b1e5c036f0b6ea881b10d9 -->
<h2>用户下单(生成实际订单,还未确认,不会给商家发单,需要通过修改接口确认下单)</h2>
<p>前端流程
前端通过购物车查看模块 提交用户要购买的商品和数量 保证商品都在同一家店铺中</p>
<p>后端流程
检查商品是否都在同一家商户
检查商品库存
检查商家是否在营业时间
检查商家是否可以使用购物券
检查用户是否提交购物券
计算购物券后金额
提交订单
消除优惠券
消除购物车</p>
<p>400 参数错误
414 没有找到相关购物车信息 无法下单
415 购物车商品必须属于同一家商家才能下单
416 超过营业时间 无法下单
417 用户提交的优惠券不是自己的优惠券或没有这个优惠券
418 商家目前不能营业
419 商家目前无法使用优惠券
420 商品库存不足 并且返回该库存不足的商品信息
421 传递的cart格式不对
511 系统错误 请联系管理员
512 商品扣除库存时失败 可能商品在下单过程中被商家移除,请重新下单</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/order" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"cart":"non","bonus":13,"desc":"quis","cover":19,"name":"nam","phone":"nam","address":"alias"}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/order"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "cart": "non",
    "bonus": 13,
    "desc": "quis",
    "cover": 19,
    "name": "nam",
    "phone": "nam",
    "address": "alias"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/order</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>cart</code></td>
<td>string</td>
<td>required</td>
<td>购物车编号 同时购买多个商品使用 1,2,3,4 这种方式 这里的1,2,3,4对应购物车接口中的id</td>
</tr>
<tr>
<td><code>bonus</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 用户使用优惠券购买商品 外键 对应优惠券的id号 用户只能使用自己的优惠券来下单</td>
</tr>
<tr>
<td><code>desc</code></td>
<td>string</td>
<td>optional</td>
<td>optional 备注信息</td>
</tr>
<tr>
<td><code>cover</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 餐具份数 默认0</td>
</tr>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>optional</td>
<td>optional 收货人姓名</td>
</tr>
<tr>
<td><code>phone</code></td>
<td>string</td>
<td>optional</td>
<td>optional 收货人手机号</td>
</tr>
<tr>
<td><code>address</code></td>
<td>string</td>
<td>optional</td>
<td>optional 收货人地址</td>
</tr>
</tbody>
</table>
<!-- END_466aaccf34b1e5c036f0b6ea881b10d9 -->
<!-- START_73d82a83d03ac6cb53366c05e7562d8f -->
<h2>订单查看接口,用户只能查看自己的订单,商户可以查看商户上面所有的订单,管理员可以查看所有订单</h2>
<p>返回值</p>
<p>400 参数错误
200 成功
414 无该订单数据</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/order/1?id=rem&amp;no=facilis&amp;total_fee=ab&amp;fee=aut&amp;bonus_fee=ut&amp;pay_status=aliquam&amp;trans_status=et&amp;status=ea&amp;accept=consectetur&amp;is_confirm=sed&amp;is_revoke=perferendis&amp;active=sed&amp;order_goods=aut&amp;order_goods-%3Enum=dolor&amp;order_goods-%3Eprice=minus&amp;order_goods-%3Egoods=et&amp;business=animi" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/order/1"
);

let params = {
    "id": "rem",
    "no": "facilis",
    "total_fee": "ab",
    "fee": "aut",
    "bonus_fee": "ut",
    "pay_status": "aliquam",
    "trans_status": "et",
    "status": "ea",
    "accept": "consectetur",
    "is_confirm": "sed",
    "is_revoke": "perferendis",
    "active": "sed",
    "order_goods": "aut",
    "order_goods-&amp;gt;num": "dolor",
    "order_goods-&amp;gt;price": "minus",
    "order_goods-&amp;gt;goods": "et",
    "business": "animi",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/order/{order}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>订单主键</td>
</tr>
<tr>
<td><code>no</code></td>
<td>optional</td>
<td>订单流水号</td>
</tr>
<tr>
<td><code>total_fee</code></td>
<td>optional</td>
<td>订单总金额</td>
</tr>
<tr>
<td><code>fee</code></td>
<td>optional</td>
<td>订单实际金额</td>
</tr>
<tr>
<td><code>bonus_fee</code></td>
<td>optional</td>
<td>优惠金额</td>
</tr>
<tr>
<td><code>pay_status</code></td>
<td>optional</td>
<td>支付状态 0 1 未支付 已支付</td>
</tr>
<tr>
<td><code>trans_status</code></td>
<td>optional</td>
<td>运送状态 1.未配送 2.配送中 3. 配送完成</td>
</tr>
<tr>
<td><code>status</code></td>
<td>optional</td>
<td>订单状态 false.未完成 true.订单完成</td>
</tr>
<tr>
<td><code>accept</code></td>
<td>optional</td>
<td>商家是否接单 0:未接单 1:已接单 2:已拒单</td>
</tr>
<tr>
<td><code>is_confirm</code></td>
<td>optional</td>
<td>用户是否已经确定下单</td>
</tr>
<tr>
<td><code>is_revoke</code></td>
<td>optional</td>
<td>用户撤销的订单 撤销的订单就无用了 0. 用户未撤销订单 1. 用户成功撤销订单 2. 用户申请撤销订单 但是商家未同意 3. 商家不同意撤单 用户可以重新申请</td>
</tr>
<tr>
<td><code>active</code></td>
<td>optional</td>
<td>订单是否正式被撤销 1 正常状态 0被撤销</td>
</tr>
<tr>
<td><code>order_goods</code></td>
<td>optional</td>
<td>数组表示订单中的购买商品情况 （数组）</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;num</code></td>
<td>optional</td>
<td>该商品购买数量</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;price</code></td>
<td>optional</td>
<td>该商品下单的时候的单价</td>
</tr>
<tr>
<td><code>order_goods-&amp;gt;goods</code></td>
<td>optional</td>
<td>该商品的详细信息 具体字段和商品信息一模一样</td>
</tr>
<tr>
<td><code>business</code></td>
<td>optional</td>
<td>商家信息 字段说明和商家信息接口一模一样</td>
</tr>
</tbody>
</table>
<!-- END_73d82a83d03ac6cb53366c05e7562d8f -->
<!-- START_9d00364e1d42d1f77e30e3426fe95321 -->
<h2>1. 用户确认下单或取消订单接口接口 用户端逻辑</h2>
<ol start="2">
<li>商家收到 确认订单 确认撤销订单 拒绝订单 改变订单运送状态</li>
</ol>
<p>前端逻辑</p>
<p>确认下单只能是用户在该api中的post方法新增的一个订单,然后确认下单 订单开始配送</p>
<p>取消订单的情况</p>
<ol>
<li>没有确认下单的订单,把这个订单取消了重新点餐</li>
<li>确认下单,商户未接单</li>
<li>确认下单,但是还没有运输,这时候需要商家同意</li>
</ol>
<p>前端状态梳理:</p>
<ol>
<li>active=0 订单已经关闭 其中
<ol>
<li>is_revoke=1 active=0 =&gt;用户退单成功 订单已经取消</li>
<li>is_finish=1 active=0 =&gt;订单已经完成 状态无法更改</li>
<li>is_confirm=0 active=0 =&gt; 订单已经取消</li>
</ol></li>
<li>active=1 订单正在激活状态中 其中
<ol>
<li>is_revoke=2 active=1 =&gt;用户正在申请退单 但是商家还没有确认</li>
<li>is_revoke=0 active=1 accept=0 =&gt;订单已经提交 商家还未接单</li>
<li>is_revoke=0 active=1 accept=1 tran_status = 1,2,3 商家已经收单 订单状态 1.未配送 2.配送中 3. 配送完成</li>
<li>is_revoke=3 active=1 =&gt;商家不同意用户的退单申请</li>
</ol></li>
</ol>
<p>后端逻辑（用户部分）</p>
<ol>
<li>取消订单返回商品库存</li>
<li>通知商家订单取消</li>
</ol>
<p>后台逻辑 （商家）</p>
<ol>
<li>确认收单</li>
<li>开始发货或确认送到货</li>
<li>确认用户退单</li>
</ol>
<p>用户部分的代码
200下单成功</p>
<p>211 用户撤销订单成功
221 商家操作成功
205商家已经接单 但是没有开始送货 所以已经通知商家确认取消订单 但是目前订单不能取消
411 订单已经下单了 无法再次下单 用户要重新提交一个新订单
412 订单已经被(用户自己)撤销了 无法下单
413 已经在配送的订单 无法撤销
414 该用户没有这个订单 无法下单
415 下单失败 请重新下单
416 申请退单接口发生异常 请重试
500 其他未知情况 系统无法判断 请联系管理员
513 撤销中未知情况 请联系管理员
423 场景 商家想拒绝或接受用户退单但是 1. 订单正在运输中 2.商家并未接受订单(商家没接收订单直接走拒绝接受通过提交accept不用提交revoke字段) 3.用户并未申请退单(并且商家已经接受订单 无法退单) 4. 订单已经在运输 无法退单'
421 该商家无权修改该订单
423 订单已经关闭状态 无法修改
422 商家已经收单 不能再收单了
424 要先确认才能配送订单
425 商家提供的配送状态不是 1 2 3 无法确认
426 要配送完成才能确认完成订单
427 商家确认订单失败 请重试
428 接受退单操作失败 请重试
429 拒绝退单操作失败 请重试
430 订单已经关闭 无限拒绝该订单
431 拒绝订单失败 请重试
432 发货失败 请重试
433 完成订单操作失败</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X PUT \
    "http://localhost/api/order/order/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"confirm":15,"because":"dicta","accept":8,"revoke":16,"trans_status":6,"is_finish":18}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/order/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "confirm": 15,
    "because": "dicta",
    "accept": 8,
    "revoke": 16,
    "trans_status": 6,
    "is_finish": 18
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>PUT api/order/order/{order}</code></p>
<p><code>PATCH api/order/order/{order}</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>confirm</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 1确认下单 0取消下单（用户端参数）</td>
</tr>
<tr>
<td><code>because</code></td>
<td>string</td>
<td>optional</td>
<td>optional 撤销原因 (用户端参数)</td>
</tr>
<tr>
<td><code>accept</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 1 商家确认收单 2:已拒单 0 商家拒绝收单(商家后台参数)</td>
</tr>
<tr>
<td><code>revoke</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 1 商家接受用户退单 0 商家不接受用户退单 (商家后台参数)</td>
</tr>
<tr>
<td><code>trans_status</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 1.未配送 2.配送中 3. 配送完成 (商家后台参数)</td>
</tr>
<tr>
<td><code>is_finish</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 1 完成订单 (商家后台参数)</td>
</tr>
</tbody>
</table>
<!-- END_9d00364e1d42d1f77e30e3426fe95321 -->
<!-- START_e0655f8c86526ec2068b689686b21978 -->
<h2>用户删除订单</h2>
<p>前端逻辑</p>
<ol>
<li>可以删除未确认的订单</li>
<li>完成的订单可以删除</li>
<li>其他订单正在执行 不能删除</li>
</ol>
<p>414 该订单不属于该用户
200 成功
411 订单目前无法删除 还在进行之中</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/order/order/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/order/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/order/order/{order}</code></p>
<!-- END_e0655f8c86526ec2068b689686b21978 -->
<h1>购物车接口</h1>
<p>采用 restful api  </p>
<p>Body Parameters 表示请求的所需要的参数</p>
<p>Query Parameters 表示返回参数的名称</p>
<!-- START_3531438c7ea088185e790ebdcba4977b -->
<h2>购物车 用户查看所有购物车情况</h2>
<p>200查询成功</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/cart?num=asperiores&amp;food-%3Ename=nesciunt&amp;food-%3Eprice=officia&amp;food-%3Efood_num=qui&amp;id=accusantium" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"business":6}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/cart"
);

let params = {
    "num": "asperiores",
    "food-&amp;gt;name": "nesciunt",
    "food-&amp;gt;price": "officia",
    "food-&amp;gt;food_num": "qui",
    "id": "accusantium",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "business": 6
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/cart</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>购买商品数量</td>
</tr>
<tr>
<td><code>food-&amp;gt;name</code></td>
<td>optional</td>
<td>商品名</td>
</tr>
<tr>
<td><code>food-&amp;gt;price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>food-&amp;gt;food_num</code></td>
<td>optional</td>
<td>库存</td>
</tr>
<tr>
<td><code>id</code></td>
<td>optional</td>
<td>购物车id号</td>
</tr>
</tbody>
</table>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>business</code></td>
<td>integer</td>
<td>optional</td>
<td>optional 过滤商家id 只显示这个用户在这个商家里面的商品信息</td>
</tr>
</tbody>
</table>
<!-- END_3531438c7ea088185e790ebdcba4977b -->
<!-- START_372d56ec5d155e466851c7f3ae3867c8 -->
<h2>用户添加或者修改购物车数量</h2>
<p>向用户的购物车中新增商品的功能
前端逻辑
提交商品id号和商品的数量
需要先登录
返回成功的商品数量 商品id 和用户id</p>
<p>权限问题
只有user_type为1的可以使用该接口</p>
<p>200 添加成功
400 请求参数错误
414 服务器错误 添加失败</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/cart" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"food":11,"num":10}'
</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/cart"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "food": 11,
    "num": 10
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/cart</code></p>
<h4>Body Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>food</code></td>
<td>integer</td>
<td>required</td>
<td>商品货号</td>
</tr>
<tr>
<td><code>num</code></td>
<td>integer</td>
<td>required</td>
<td>商品数量</td>
</tr>
</tbody>
</table>
<!-- END_372d56ec5d155e466851c7f3ae3867c8 -->
<!-- START_8c32673521de96dfd2735e51a1faa47c -->
<h2>用户在一个商家中的所有购物车 用户获取在特定商家中的所有购物车信息 url后的id表示商家的id号</h2>
<p>商家的id号和获取商家信息中使用的id号一致</p>
<p>权限问题
只有user_type为1的可以使用该接口
用户本人通过会话获取本人的购物车 无法获取他人的购物车</p>
<p>200 查询成功
414 没有该购物车数据</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X GET \
    -G "http://localhost/api/order/cart/1?num=placeat&amp;food-%3Ename=mollitia&amp;food-%3Eprice=rerum&amp;food-%3Efood_num=iste" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/cart/1"
);

let params = {
    "num": "placeat",
    "food-&amp;gt;name": "mollitia",
    "food-&amp;gt;price": "rerum",
    "food-&amp;gt;food_num": "iste",
};
Object.keys(params)
    .forEach(key =&gt; url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<blockquote>
<p>Example response (401):</p>
</blockquote>
<pre><code class="language-json">"token error"</code></pre>
<h3>HTTP Request</h3>
<p><code>GET api/order/cart/{cart}</code></p>
<h4>Query Parameters</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>num</code></td>
<td>optional</td>
<td>购买商品数量</td>
</tr>
<tr>
<td><code>food-&amp;gt;name</code></td>
<td>optional</td>
<td>商品名</td>
</tr>
<tr>
<td><code>food-&amp;gt;price</code></td>
<td>optional</td>
<td>价格</td>
</tr>
<tr>
<td><code>food-&amp;gt;food_num</code></td>
<td>optional</td>
<td>库存</td>
</tr>
</tbody>
</table>
<!-- END_8c32673521de96dfd2735e51a1faa47c -->
<!-- START_2f40320b36ba841b328e81925b5e6a60 -->
<h2>用户删除购物车 这里是一条一条的删除</h2>
<p>414 没有这个购物车信息 无法删除
200 成功删除</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X DELETE \
    "http://localhost/api/order/cart/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/cart/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>DELETE api/order/cart/{cart}</code></p>
<!-- END_2f40320b36ba841b328e81925b5e6a60 -->
<!-- START_5822f4aa05aedf1a69ad8bc0a6c6acde -->
<h2>用户删除全部购物车</h2>
<p>503 删除失败
200 成功删除</p>
<blockquote>
<p>Example request:</p>
</blockquote>
<pre><code class="language-bash">curl -X POST \
    "http://localhost/api/order/cart/delete" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"</code></pre>
<pre><code class="language-javascript">const url = new URL(
    "http://localhost/api/order/cart/delete"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response =&gt; response.json())
    .then(json =&gt; console.log(json));</code></pre>
<h3>HTTP Request</h3>
<p><code>POST api/order/cart/delete</code></p>
<!-- END_5822f4aa05aedf1a69ad8bc0a6c6acde -->
      </div>
      <div class="dark-box">
                        <div class="lang-selector">
                                    <a href="#" data-language-name="bash">bash</a>
                                    <a href="#" data-language-name="javascript">javascript</a>
                              </div>
                </div>
    </div>
  </body>
</html>